about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-04-24 00:22:34 +0200
committerflip1995 <hello@philkrones.com>2020-04-24 00:22:34 +0200
commit602f206408bea967f0f3934d14b918a43a11845d (patch)
tree274e21a47a2ee82dca8602c71fc10fcdb81a9bec
parent413a12909f3b149af17d75268ed4a136afb82c36 (diff)
downloadrust-602f206408bea967f0f3934d14b918a43a11845d.tar.gz
rust-602f206408bea967f0f3934d14b918a43a11845d.zip
Use correct span on while (let) lowering
-rw-r--r--src/librustc_ast_lowering/expr.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_ast_lowering/expr.rs b/src/librustc_ast_lowering/expr.rs
index 0eed47050aa..cbe192d35e5 100644
--- a/src/librustc_ast_lowering/expr.rs
+++ b/src/librustc_ast_lowering/expr.rs
@@ -397,12 +397,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
         let then_arm = self.arm(then_pat, self.arena.alloc(then_expr));
 
         // `match <scrutinee> { ... }`
-        let match_expr = self.expr_match(
-            scrutinee.span,
-            scrutinee,
-            arena_vec![self; then_arm, else_arm],
-            desugar,
-        );
+        let match_expr =
+            self.expr_match(span, scrutinee, arena_vec![self; then_arm, else_arm], desugar);
 
         // `[opt_ident]: loop { ... }`
         hir::ExprKind::Loop(self.block_expr(self.arena.alloc(match_expr)), opt_label, source)