rust/tests
bors da1d099f91 Auto merge of #112945 - compiler-errors:tighten-span-of-adjustment-error, r=oli-obk
(re-)tighten sourceinfo span of adjustments in MIR

Diagnostics rely on the spans of MIR statements being (approximately) correct in order to give suggestions relative to that span (i.e. `shrink_to_hi` and `shrink_to_lo`).

I discovered that we're *intentionally* lowering THIR exprs with their parent expr's span if they come from adjustments that are due to a parent expression. While I understand why that may be desirable to demonstrate the relationship of an adjustment and the expression that requires it, it leads to

1. very verbose borrowck output
2. incorrect spans for suggestions

Some diagnostics get around that by giving suggestions relative to other spans we've collected during MIR lowering, such as the span of the method's identifier (e.g. `name` in `.name()`), but this doesn't work too well when things come from desugaring.

I assume it also has lead to numerous tweaks and complications to diagnostics code down the road, which this PR doesn't necessarily aim to fix but may open the gates to fixing later... The last three commits are simplifications due to the fact that we can assume that the move span actually points to what is being moved (and a test).

This regressed in #89110, which was debated somewhat in #90286. cc `@Aaron1011` who originally made this change.

r? diagnostics

Fixes #113547
Fixes #111016
2023-07-12 12:11:09 +00:00
..
assembly test-various: run codegen and assembly tests 2023-07-02 02:22:22 +02:00
auxiliary
codegen Rollup merge of #113247 - mirkootter:test-wasm-exceptions-nostd, r=Mark-Simulacrum 2023-07-09 16:33:36 +02:00
codegen-units
debuginfo
incremental Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
mir-opt Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot 2023-07-08 20:53:29 +02:00
pretty
run-coverage Re-enable some coverage tests on Linux 2023-07-06 10:19:31 +10:00
run-coverage-rustdoc Re-bless the newly-migrated tests 2023-06-28 11:09:19 +10:00
run-make Rollup merge of #113247 - mirkootter:test-wasm-exceptions-nostd, r=Mark-Simulacrum 2023-07-09 16:33:36 +02:00
run-make-fulldeps Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
run-pass-valgrind
rustdoc Rollup merge of #113058 - GuillaumeGomez:improve-code-comments, r=notriddle 2023-06-27 07:01:32 +02:00
rustdoc-gui Migrate GUI colors test to original CSS color format 2023-07-08 14:56:15 +02:00
rustdoc-js Auto merge of #112233 - notriddle:notriddle/search-unify, r=GuillaumeGomez 2023-06-15 03:04:46 +00:00
rustdoc-js-std Auto merge of #108537 - GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle 2023-07-02 18:49:29 +00:00
rustdoc-json
rustdoc-ui rustdoc: get unnormalized link destination for suggestions 2023-05-26 18:38:46 -07:00
ui Auto merge of #112945 - compiler-errors:tighten-span-of-adjustment-error, r=oli-obk 2023-07-12 12:11:09 +00:00
ui-fulldeps Rollup merge of #113373 - jyn514:download-rustc-fixes, r=albertlarsan68 2023-07-11 21:00:27 -07:00
COMPILER_TESTS.md