about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-02-29 12:06:51 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-02-29 12:07:41 +0100
commit3770cf7abf2c62667e8b197be1bea3665e75a8f1 (patch)
treef8c739603d3e9e295fd18bb96a3293adb755d8b6 /compiler/rustc_resolve/src
parent632d26aeff1a943d4791ddad3025af61e0ff2256 (diff)
downloadrust-3770cf7abf2c62667e8b197be1bea3665e75a8f1.tar.gz
rust-3770cf7abf2c62667e8b197be1bea3665e75a8f1.zip
Improve suggestion to rename type starting with underscore to make it more obvious what is actually suggested
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 222dd69dbc4..6e8499be9e8 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -1571,9 +1571,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         {
             // When the suggested binding change would be from `x` to `_x`, suggest changing the
             // original binding definition instead. (#60164)
-            (span, snippet, ", consider changing it")
+            let post = format!(", consider renaming `{}` into `{snippet}`", suggestion.candidate);
+            (span, snippet, post)
         } else {
-            (span, suggestion.candidate.to_string(), "")
+            (span, suggestion.candidate.to_string(), String::new())
         };
         let msg = match suggestion.target {
             SuggestionTarget::SimilarlyNamed => format!(