diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-02-29 12:06:51 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-02-29 12:07:41 +0100 |
| commit | 3770cf7abf2c62667e8b197be1bea3665e75a8f1 (patch) | |
| tree | f8c739603d3e9e295fd18bb96a3293adb755d8b6 /compiler/rustc_resolve/src | |
| parent | 632d26aeff1a943d4791ddad3025af61e0ff2256 (diff) | |
| download | rust-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.rs | 5 |
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!( |
