Make missing lifetime suggestion verbose

This commit is contained in:
Michael Goulet
2025-06-24 18:59:29 +00:00
parent 36b21637e9
commit 250b5d204f
27 changed files with 247 additions and 123 deletions

View File

@@ -3122,15 +3122,10 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
&mut err,
Some(lifetime_ref.ident.name.as_str()),
|err, _, span, message, suggestion, span_suggs| {
err.multipart_suggestion_with_style(
err.multipart_suggestion_verbose(
message,
std::iter::once((span, suggestion)).chain(span_suggs.clone()).collect(),
Applicability::MaybeIncorrect,
if span_suggs.is_empty() {
SuggestionStyle::ShowCode
} else {
SuggestionStyle::ShowAlways
},
);
true
},