about summary refs log tree commit diff
path: root/tests/ui/parser/trait-object-polytrait-priority.stderr
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-04-15 07:44:24 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-04-15 10:08:49 +0200
commit6242335fdb7444876abf1c3669b6aab1649a0a64 (patch)
tree4eebc86603d28b2ceba1cfe8abb60c7fad06e802 /tests/ui/parser/trait-object-polytrait-priority.stderr
parent8887af72a0b1f37a34b02d488ca3278576e2d73d (diff)
downloadrust-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.stderr')
-rw-r--r--tests/ui/parser/trait-object-polytrait-priority.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/parser/trait-object-polytrait-priority.stderr b/tests/ui/parser/trait-object-polytrait-priority.stderr
index 8cb564e7930..a291a8e229c 100644
--- a/tests/ui/parser/trait-object-polytrait-priority.stderr
+++ b/tests/ui/parser/trait-object-polytrait-priority.stderr
@@ -1,8 +1,8 @@
-error[E0178]: expected a path on the left-hand side of `+`, not `&for<'a> Trait<'a>`
+error[E0178]: expected a path on the left-hand side of `+`
   --> $DIR/trait-object-polytrait-priority.rs:6:12
    |
 LL |     let _: &for<'a> Trait<'a> + 'static;
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            ^^^^^^^^^^^^^^^^^^
    |
 help: try adding parentheses
    |