rust/src/test
bors 4aa7879b55 Auto merge of #89110 - Aaron1011:adjustment-span, r=estebank
Use larger span for adjustment THIR expressions

Currently, we use a relatively 'small' span for THIR
expressions generated by an 'adjustment' (e.g. an autoderef,
autoborrow, unsizing). As a result, if a borrow generated
by an adustment ends up causing a borrowcheck error, for example:

```rust
let mut my_var = String::new();
let my_ref = &my_var
my_var.push('a');
my_ref;
```

then the span for the mutable borrow may end up referring
to only the base expression (e.g. `my_var`), rather than
the method call which triggered the mutable borrow
(e.g. `my_var.push('a')`)

Due to a quirk of the MIR borrowck implementation,
this doesn't always get exposed in migration mode,
but it does in many cases.

This commit makes THIR building consistently use 'larger'
spans for adjustment expressions. These spans are recoded
when we first create the adjustment during typecheck. For
example, an autoref adjustment triggered by a method call
will record the span of the entire method call.

The intent of this change it make it clearer to users
when it's the specific way in which a variable is
used (for example, in a method call) that produdes
a borrowcheck error. For example, an error message
claiming that a 'mutable borrow occurs here' might
be confusing if it just points at a usage of a variable
(e.g. `my_var`), when no `&mut` is in sight. Pointing
at the entire expression should help to emphasize
that the method call itself is responsible for
the mutable borrow.

In several cases, this makes the `#![feature(nll)]` diagnostic
output match up exactly with the default (migration mode) output.
As a result, several `.nll.stderr` files end up getting removed
entirely.
2021-09-30 01:40:30 +00:00
..
assembly rustc_codegen_llvm: make sse4.2 imply crc32 for LLVM 14 2021-09-20 11:31:55 -04:00
auxiliary
codegen Pin panic-in-drop=abort test to old pass manager 2021-09-25 12:40:16 +02:00
codegen-units Support incremental in compiletest for non-incremental modes. 2021-09-23 12:16:51 -07:00
debuginfo Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
incremental Bless incremental tests. 2021-09-20 08:32:21 +02:00
mir-opt Auto merge of #89110 - Aaron1011:adjustment-span, r=estebank 2021-09-30 01:40:30 +00:00
pretty Use ZST for fmt unsafety 2021-09-21 10:04:44 -05:00
run-make Auto merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle, r=petrochenkov 2021-09-07 12:31:11 +00:00
run-make-fulldeps Fix test 2021-09-22 11:48:01 -05:00
run-pass-valgrind
rustdoc Rollup merge of #89198 - hkmatsumoto:hide-hidden-methods, r=jyn514 2021-09-25 18:22:19 -07:00
rustdoc-gui Rollup merge of #88896 - GuillaumeGomez:flakyness, r=camelid 2021-09-13 21:20:43 +02:00
rustdoc-js fix(rustdoc): generics search 2021-07-01 06:40:27 -07:00
rustdoc-js-std Fix linkcheck issues 2021-09-12 02:30:24 +00:00
rustdoc-json Fix populate of union.impls 2021-09-26 18:22:07 +02:00
rustdoc-ui Use the correct edition when syntax highlighting doctests 2021-09-26 16:36:33 +00:00
ui Auto merge of #89110 - Aaron1011:adjustment-span, r=estebank 2021-09-30 01:40:30 +00:00
ui-fulldeps Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
COMPILER_TESTS.md