summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/expr.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2022-11-02 21:22:24 -0700
committerEsteban Küber <esteban@kuber.com.ar>2022-11-23 12:17:47 -0800
commit9e72e35ceb2af024e8ca6a74442269f7ec739173 (patch)
tree0ece761391df7d3342f6cb34e9524cdf08aa38c2 /compiler/rustc_ast_lowering/src/expr.rs
parentd121aa3b5584eb919a4aaf64dbae0ea1e8e30231 (diff)
downloadrust-9e72e35ceb2af024e8ca6a74442269f7ec739173.tar.gz
rust-9e72e35ceb2af024e8ca6a74442269f7ec739173.zip
Suggest `.clone()` or `ref binding` on E0382
Diffstat (limited to 'compiler/rustc_ast_lowering/src/expr.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/expr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs
index a00100ee0a8..6215d9af370 100644
--- a/compiler/rustc_ast_lowering/src/expr.rs
+++ b/compiler/rustc_ast_lowering/src/expr.rs
@@ -131,12 +131,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
                     let span = this.mark_span_with_reason(DesugaringKind::WhileLoop, e.span, None);
                     this.lower_expr_while_in_loop_scope(span, cond, body, *opt_label)
                 }),
-                ExprKind::Loop(body, opt_label) => self.with_loop_scope(e.id, |this| {
+                ExprKind::Loop(body, opt_label, span) => self.with_loop_scope(e.id, |this| {
                     hir::ExprKind::Loop(
                         this.lower_block(body, false),
                         this.lower_label(*opt_label),
                         hir::LoopSource::Loop,
-                        DUMMY_SP,
+                        this.lower_span(span),
                     )
                 }),
                 ExprKind::TryBlock(body) => self.lower_expr_try_block(body),