@@ -173,10 +173,10 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
173
173
for arm in hir_arms {
174
174
// Check the arm for some things unrelated to exhaustiveness.
175
175
self . check_patterns ( & arm. pat , Refutable ) ;
176
- if let Some ( hir:: Guard :: IfLet ( ref pat , _ ) ) = arm. guard {
177
- self . check_patterns ( pat, Refutable ) ;
178
- let tpat = self . lower_pattern ( & mut cx, pat, & mut false ) ;
179
- self . check_let_reachability ( & mut cx, pat. hir_id , tpat, tpat. span ( ) ) ;
176
+ if let Some ( hir:: Guard :: IfLet ( ref let_expr ) ) = arm. guard {
177
+ self . check_patterns ( let_expr . pat , Refutable ) ;
178
+ let tpat = self . lower_pattern ( & mut cx, let_expr . pat , & mut false ) ;
179
+ self . check_let_reachability ( & mut cx, let_expr . pat . hir_id , tpat, tpat. span ( ) ) ;
180
180
}
181
181
}
182
182
@@ -1108,9 +1108,9 @@ fn let_source_parent(tcx: TyCtxt<'_>, parent: HirId, pat_id: Option<HirId>) -> L
1108
1108
1109
1109
match parent_node {
1110
1110
hir:: Node :: Arm ( hir:: Arm {
1111
- guard : Some ( hir:: Guard :: IfLet ( & hir:: Pat { hir_id, .. } , _ ) ) ,
1111
+ guard : Some ( hir:: Guard :: IfLet ( & hir:: Let { pat : hir :: Pat { hir_id, .. } , .. } ) ) ,
1112
1112
..
1113
- } ) if Some ( hir_id) == pat_id => {
1113
+ } ) if Some ( * hir_id) == pat_id => {
1114
1114
return LetSource :: IfLetGuard ;
1115
1115
}
1116
1116
hir:: Node :: Expr ( hir:: Expr { kind : hir:: ExprKind :: Let ( ..) , span, .. } ) => {
0 commit comments