@@ -425,7 +425,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
425425 None ,
426426 arm. span ,
427427 & arm. pattern ,
428- arm. guard . as_ref ( ) ,
428+ arm. guard ,
429429 opt_scrutinee_place,
430430 ) ;
431431
@@ -717,7 +717,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
717717 mut visibility_scope : Option < SourceScope > ,
718718 scope_span : Span ,
719719 pattern : & Pat < ' tcx > ,
720- guard : Option < & Guard < ' tcx > > ,
720+ guard : Option < ExprId > ,
721721 opt_match_place : Option < ( Option < & Place < ' tcx > > , Span ) > ,
722722 ) -> Option < SourceScope > {
723723 self . visit_primary_bindings (
@@ -745,7 +745,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
745745 ) ;
746746 } ,
747747 ) ;
748- if let Some ( & Guard :: If ( guard_expr) ) = guard {
748+ if let Some ( guard_expr) = guard {
749749 self . declare_guard_bindings ( guard_expr, scope_span, visibility_scope) ;
750750 }
751751 visibility_scope
@@ -2044,7 +2044,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
20442044 // * So we eagerly create the reference for the arm and then take a
20452045 // reference to that.
20462046 if let Some ( ( arm, match_scope) ) = arm_match_scope
2047- && let Some ( guard) = & arm. guard
2047+ && let Some ( guard) = arm. guard
20482048 {
20492049 let tcx = self . tcx ;
20502050 let bindings = parent_bindings
@@ -2069,22 +2069,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
20692069 let mut guard_span = rustc_span:: DUMMY_SP ;
20702070
20712071 let ( post_guard_block, otherwise_post_guard_block) =
2072- self . in_if_then_scope ( match_scope, guard_span, |this| match * guard {
2073- Guard :: If ( e) => {
2074- guard_span = this. thir [ e] . span ;
2075- this. then_else_break (
2076- block,
2077- e,
2078- None ,
2079- match_scope,
2080- this. source_info ( arm. span ) ,
2081- false ,
2082- )
2083- }
2084- Guard :: IfLet ( ref pat, s) => {
2085- guard_span = this. thir [ s] . span ;
2086- this. lower_let_expr ( block, s, pat, match_scope, None , arm. span , false )
2087- }
2072+ self . in_if_then_scope ( match_scope, guard_span, |this| {
2073+ guard_span = this. thir [ guard] . span ;
2074+ this. then_else_break (
2075+ block,
2076+ guard,
2077+ None ,
2078+ match_scope,
2079+ this. source_info ( arm. span ) ,
2080+ false ,
2081+ )
20882082 } ) ;
20892083
20902084 let source_info = self . source_info ( guard_span) ;
0 commit comments