1
Fork 0

Verbose suggestions

This commit is contained in:
Esteban Küber 2023-01-01 00:06:31 -08:00
parent 5bfcfeee2a
commit 545406528a
53 changed files with 363 additions and 188 deletions

View file

@ -377,10 +377,10 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
err.span_label(span, format!("cannot {act}"));
}
if suggest {
err.span_suggestion(
local_decl.source_info.span,
err.span_suggestion_verbose(
local_decl.source_info.span.shrink_to_lo(),
"consider changing this to be mutable",
format!("mut {}", self.local_names[local].unwrap()),
"mut ".to_string(),
Applicability::MachineApplicable,
);
let tcx = self.infcx.tcx;