Skip to content

Commit

Permalink
Use correct span on while (let) lowering
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Apr 23, 2020
1 parent 413a129 commit 602f206
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/librustc_ast_lowering/expr.rs
Expand Up @@ -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)
Expand Down

0 comments on commit 602f206

Please sign in to comment.