]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/array_into_iter.rs
Don't mark for loop head span with desugaring
[rust.git] / compiler / rustc_lint / src / array_into_iter.rs
index d147148ac71363f6b2feb1d23c0420e8cda4740b..d8883b0e66dba77be936bb086f2197af5d384880 100644 (file)
@@ -134,9 +134,8 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
                     Applicability::MachineApplicable,
                 );
                 if self.for_expr_span == expr.span {
-                    let expr_span = expr.span.ctxt().outer_expn_data().call_site;
                     diag.span_suggestion(
-                        receiver_arg.span.shrink_to_hi().to(expr_span.shrink_to_hi()),
+                        receiver_arg.span.shrink_to_hi().to(expr.span.shrink_to_hi()),
                         "or remove `.into_iter()` to iterate by value",
                         String::new(),
                         Applicability::MaybeIncorrect,