rust/src/test/ui/codemap_tests
Aaron Hill 4d66986e09
Use larger span for adjustments on method calls
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

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-25 10:00:41 -05:00
..
bad-format-args.rs Improve recovery on malformed format call 2020-09-02 13:18:19 +02:00
bad-format-args.stderr Show macro name in 'this error originates in macro' message 2021-05-12 19:03:06 -04:00
coherence-overlapping-inherent-impl-trait.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
coherence-overlapping-inherent-impl-trait.stderr Use smaller def span for functions 2020-08-22 18:41:49 -04:00
empty_span.rs introduce negative_impls feature gate and document 2020-03-26 06:52:55 -04:00
empty_span.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
huge_multispan_highlight.rs Remove licenses 2018-12-25 21:08:33 -07:00
huge_multispan_highlight.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
issue-11715.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-11715.stderr Use larger span for adjustments on method calls 2021-09-25 10:00:41 -05:00
issue-28308.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-28308.stderr Show macro name in 'this error originates in macro' message 2021-05-12 19:03:06 -04:00
one_line.rs Remove licenses 2018-12-25 21:08:33 -07:00
one_line.stderr Use larger span for adjustments on method calls 2021-09-25 10:00:41 -05:00
overlapping_inherent_impls.rs Remove licenses 2018-12-25 21:08:33 -07:00
overlapping_inherent_impls.stderr Use smaller def span for functions 2020-08-22 18:41:49 -04:00
tab.rs Remove licenses 2018-12-25 21:08:33 -07:00
tab.stderr Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
tab_2.rs Remove licenses 2018-12-25 21:08:33 -07:00
tab_2.stderr Update UI tests 2020-06-21 16:40:36 +02:00
tab_3.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
tab_3.stderr Change wording of note 2021-01-08 14:57:35 -05:00
two_files.rs Remove licenses 2018-12-25 21:08:33 -07:00
two_files.stderr Add a suggestion when using a type alias instead of trait alias 2021-04-01 09:53:46 +09:00
two_files_data.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
unicode.rs Remove licenses 2018-12-25 21:08:33 -07:00
unicode.stderr rustc: Add a new wasm ABI 2021-04-08 08:03:18 -07:00
unicode_2.rs Stablize non_ascii_idents feature. 2021-04-08 02:52:00 +08:00
unicode_2.stderr Stablize non_ascii_idents feature. 2021-04-08 02:52:00 +08:00
unicode_3.rs Moving more build-pass tests to check-pass 2020-04-23 20:21:38 -07:00
unicode_3.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00