diff options
| author | bors <bors@rust-lang.org> | 2023-01-31 13:53:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-31 13:53:40 +0000 |
| commit | f361413cbf44ce2f144df59fc440cd484af4a56e (patch) | |
| tree | cecf91d94ee20df2d6bec7c88796b90fa34f9887 /tests/ui/function-pointer | |
| parent | a64ef7d07d0411315be85a646586cb85eeb9c136 (diff) | |
| parent | 449dfc64f0792f2320ef68bc08f238281199f53d (diff) | |
| download | rust-f361413cbf44ce2f144df59fc440cd484af4a56e.tar.gz rust-f361413cbf44ce2f144df59fc440cd484af4a56e.zip | |
Auto merge of #106399 - estebank:type-err-span-label, r=nagisa
Modify primary span label for E0308 Looking at the reactions to https://hachyderm.io/`@ekuber/109622160673605438,` a lot of people seem to have trouble understanding the current output, where the primary span label on type errors talks about the specific types that diverged, but these can be deeply nested type parameters. Because of that we could see "expected i32, found u32" in the label while the note said "expected Vec<i32>, found Vec<u32>". This understandably confuses people. I believe that once people learn to read these errors it starts to make more sense, but this PR changes the output to be more in line with what people might expect, without sacrificing terseness. Fix #68220.
Diffstat (limited to 'tests/ui/function-pointer')
| -rw-r--r-- | tests/ui/function-pointer/unsized-ret.stderr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/function-pointer/unsized-ret.stderr b/tests/ui/function-pointer/unsized-ret.stderr index 6f430687e6d..870f1805b58 100644 --- a/tests/ui/function-pointer/unsized-ret.stderr +++ b/tests/ui/function-pointer/unsized-ret.stderr @@ -23,7 +23,7 @@ LL | foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&() | required by a bound introduced by this call | = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)` - = note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn Display + 'a)` + = note: required because it appears within the type `fn(&()) -> dyn Display` note: required by a bound in `foo` --> $DIR/unsized-ret.rs:5:11 | |
