about summary refs log tree commit diff
path: root/compiler/rustc_parse/messages.ftl
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 /compiler/rustc_parse/messages.ftl
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 'compiler/rustc_parse/messages.ftl')
-rw-r--r--compiler/rustc_parse/messages.ftl2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/messages.ftl b/compiler/rustc_parse/messages.ftl
index e2b5e1cdd0a..80cd87a69f7 100644
--- a/compiler/rustc_parse/messages.ftl
+++ b/compiler/rustc_parse/messages.ftl
@@ -543,7 +543,7 @@ parse_maybe_recover_from_bad_qpath_stage_2 =
     .suggestion = types that don't start with an identifier need to be surrounded with angle brackets in qualified paths
 
 parse_maybe_recover_from_bad_type_plus =
-    expected a path on the left-hand side of `+`, not `{$ty}`
+    expected a path on the left-hand side of `+`
 
 parse_maybe_report_ambiguous_plus =
     ambiguous `+` in a type