Rollup merge of #87453 - ibraheemdev:i-68697, r=wesleywiser
Suggest removing unnecessary &mut as help message Closes #68697
This commit is contained in:
commit
954137ea0e
15 changed files with 46 additions and 24 deletions
|
@ -242,7 +242,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
|
||||
|
@ -324,7 +329,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