suggest removing unnecessary \&mut as help message
This commit is contained in:
parent
e1d49aaad4
commit
e8238a78df
15 changed files with 47 additions and 37 deletions
|
@ -240,7 +240,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
.unwrap_or(false) =>
|
||||
{
|
||||
err.span_label(span, format!("cannot {ACT}", ACT = act));
|
||||
err.span_label(span, "try removing `&mut` here");
|
||||
err.span_suggestion(
|
||||
span,
|
||||
"try removing `&mut` here",
|
||||
String::new(),
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
|
||||
// We want to suggest users use `let mut` for local (user
|
||||
|
@ -322,7 +327,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
} =>
|
||||
{
|
||||
err.span_label(span, format!("cannot {ACT}", ACT = act));
|
||||
err.span_label(span, "try removing `&mut` here");
|
||||
err.span_suggestion(
|
||||
span,
|
||||
"try removing `&mut` here",
|
||||
String::new(),
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
|
||||
PlaceRef { local, projection: [ProjectionElem::Deref] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue