about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-03-28 11:47:01 -0700
committerMichael Howell <michael@notriddle.com>2022-03-28 11:48:14 -0700
commita063b3a4b6eed93d07c084d6e34dbe7d02e02b04 (patch)
treebd7a59503d1d1ec17516bdf466562ddeedae484b
parent2d37f38f872859b2b096772765a7987199c852c4 (diff)
downloadrust-a063b3a4b6eed93d07c084d6e34dbe7d02e02b04.tar.gz
rust-a063b3a4b6eed93d07c084d6e34dbe7d02e02b04.zip
diagnostics: do not suggest `map.iter_mut()()`
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
index c77bbeb86e5..6e551e95cbb 100644
--- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
@@ -787,7 +787,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
                                                         _,
                                                         [
                                                             Expr {
-                                                                kind: MethodCall(path_segment, ..),
+                                                                kind:
+                                                                    MethodCall(
+                                                                        path_segment,
+                                                                        _args,
+                                                                        span,
+                                                                    ),
                                                                 hir_id,
                                                                 ..
                                                             },
@@ -831,7 +836,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
                 if let Some(mut suggestions) = opt_suggestions {
                     if suggestions.peek().is_some() {
                         err.span_suggestions(
-                            path_segment.ident.span,
+                            *span,
                             "use mutable method",
                             suggestions,
                             Applicability::MaybeIncorrect,