Skip to content

Commit a063b3a

Browse files
committed
diagnostics: do not suggest map.iter_mut()()
1 parent 2d37f38 commit a063b3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
787787
_,
788788
[
789789
Expr {
790-
kind: MethodCall(path_segment, ..),
790+
kind:
791+
MethodCall(
792+
path_segment,
793+
_args,
794+
span,
795+
),
791796
hir_id,
792797
..
793798
},
@@ -831,7 +836,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
831836
if let Some(mut suggestions) = opt_suggestions {
832837
if suggestions.peek().is_some() {
833838
err.span_suggestions(
834-
path_segment.ident.span,
839+
*span,
835840
"use mutable method",
836841
suggestions,
837842
Applicability::MaybeIncorrect,

0 commit comments

Comments
 (0)