File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
compiler/rustc_ast_lowering/src Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -442,18 +442,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
442
442
then : & Block ,
443
443
else_opt : Option < & Expr > ,
444
444
) -> hir:: ExprKind < ' hir > {
445
- macro_rules! make_if {
446
- ( $opt: expr) => { {
447
- let cond = self . lower_expr( cond) ;
448
- let then_expr = self . lower_block_expr( then) ;
449
- hir:: ExprKind :: If ( cond, self . arena. alloc( then_expr) , $opt)
450
- } } ;
451
- }
452
- if let Some ( rslt) = else_opt {
453
- make_if ! ( Some ( self . lower_expr( rslt) ) )
454
- } else {
455
- make_if ! ( None )
456
- }
445
+ let cond = self . lower_expr ( cond) ;
446
+ let then = self . arena . alloc ( self . lower_block_expr ( then) ) ;
447
+ let els = else_opt. map ( |els| self . lower_expr ( els) ) ;
448
+ hir:: ExprKind :: If ( cond, then, els)
457
449
}
458
450
459
451
fn lower_expr_if_let (
You can’t perform that action at this time.
0 commit comments