@@ -353,7 +353,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
353
353
let else_arm = self . arm ( else_pat, else_expr) ;
354
354
355
355
// Handle then + scrutinee:
356
- let then_expr = self . lower_block_expr ( then) ;
357
356
let ( then_pat, scrutinee, desugar) = match cond. kind {
358
357
// `<pat> => <then>`:
359
358
ExprKind :: Let ( ref pat, ref scrutinee) => {
@@ -375,6 +374,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
375
374
( pat, cond, hir:: MatchSource :: IfDesugar { contains_else_clause } )
376
375
}
377
376
} ;
377
+ let then_expr = self . lower_block_expr ( then) ;
378
378
let then_arm = self . arm ( then_pat, self . arena . alloc ( then_expr) ) ;
379
379
380
380
hir:: ExprKind :: Match ( scrutinee, arena_vec ! [ self ; then_arm, else_arm] , desugar)
@@ -400,7 +400,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
400
400
} ;
401
401
402
402
// Handle then + scrutinee:
403
- let then_expr = self . lower_block_expr ( body) ;
404
403
let ( then_pat, scrutinee, desugar, source) = match cond. kind {
405
404
ExprKind :: Let ( ref pat, ref scrutinee) => {
406
405
// to:
@@ -440,6 +439,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
440
439
( pat, cond, hir:: MatchSource :: WhileDesugar , hir:: LoopSource :: While )
441
440
}
442
441
} ;
442
+ let then_expr = self . lower_block_expr ( body) ;
443
443
let then_arm = self . arm ( then_pat, self . arena . alloc ( then_expr) ) ;
444
444
445
445
// `match <scrutinee> { ... }`
0 commit comments