@@ -425,7 +425,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
425
425
None ,
426
426
arm. span ,
427
427
& arm. pattern ,
428
- arm. guard . as_ref ( ) ,
428
+ arm. guard ,
429
429
opt_scrutinee_place,
430
430
) ;
431
431
@@ -717,7 +717,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
717
717
mut visibility_scope : Option < SourceScope > ,
718
718
scope_span : Span ,
719
719
pattern : & Pat < ' tcx > ,
720
- guard : Option < & Guard < ' tcx > > ,
720
+ guard : Option < ExprId > ,
721
721
opt_match_place : Option < ( Option < & Place < ' tcx > > , Span ) > ,
722
722
) -> Option < SourceScope > {
723
723
self . visit_primary_bindings (
@@ -745,7 +745,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
745
745
) ;
746
746
} ,
747
747
) ;
748
- if let Some ( & Guard :: If ( guard_expr) ) = guard {
748
+ if let Some ( guard_expr) = guard {
749
749
self . declare_guard_bindings ( guard_expr, scope_span, visibility_scope) ;
750
750
}
751
751
visibility_scope
@@ -2044,7 +2044,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2044
2044
// * So we eagerly create the reference for the arm and then take a
2045
2045
// reference to that.
2046
2046
if let Some ( ( arm, match_scope) ) = arm_match_scope
2047
- && let Some ( guard) = & arm. guard
2047
+ && let Some ( guard) = arm. guard
2048
2048
{
2049
2049
let tcx = self . tcx ;
2050
2050
let bindings = parent_bindings
@@ -2069,22 +2069,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2069
2069
let mut guard_span = rustc_span:: DUMMY_SP ;
2070
2070
2071
2071
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
+ )
2088
2082
} ) ;
2089
2083
2090
2084
let source_info = self . source_info ( guard_span) ;
0 commit comments