diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-04-15 07:44:24 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2025-04-15 10:08:49 +0200 |
| commit | 6242335fdb7444876abf1c3669b6aab1649a0a64 (patch) | |
| tree | 4eebc86603d28b2ceba1cfe8abb60c7fad06e802 /tests/ui/parser/trait-object-polytrait-priority.rs | |
| parent | 8887af72a0b1f37a34b02d488ca3278576e2d73d (diff) | |
| download | rust-6242335fdb7444876abf1c3669b6aab1649a0a64.tar.gz rust-6242335fdb7444876abf1c3669b6aab1649a0a64.zip | |
Improve diagnostic for E0178 (bad `+` in type)
Namely, use a more sensical primary span. Don't pretty-print AST nodes for the diagnostic message. Why: * It's lossy (e.g., it doesn't replicate trailing `+`s in trait objects. * It's prone to leak error nodes (printed as `(/*ERROR*/)`) since the LHS can easily represent recovered code (e.g., `fn(i32?) + T`).
Diffstat (limited to 'tests/ui/parser/trait-object-polytrait-priority.rs')
| -rw-r--r-- | tests/ui/parser/trait-object-polytrait-priority.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/parser/trait-object-polytrait-priority.rs b/tests/ui/parser/trait-object-polytrait-priority.rs index e7f085104ae..85568f0fe1b 100644 --- a/tests/ui/parser/trait-object-polytrait-priority.rs +++ b/tests/ui/parser/trait-object-polytrait-priority.rs @@ -4,6 +4,6 @@ trait Trait<'a> {} fn main() { let _: &for<'a> Trait<'a> + 'static; - //~^ ERROR expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>` + //~^ ERROR expected a path on the left-hand side of `+` //~| HELP try adding parentheses } |
