@@ -173,10 +173,10 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
173173 for arm in hir_arms {
174174 // Check the arm for some things unrelated to exhaustiveness.
175175 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 ( ) ) ;
180180 }
181181 }
182182
@@ -1108,9 +1108,9 @@ fn let_source_parent(tcx: TyCtxt<'_>, parent: HirId, pat_id: Option<HirId>) -> L
11081108
11091109 match parent_node {
11101110 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, .. } , .. } ) ) ,
11121112 ..
1113- } ) if Some ( hir_id) == pat_id => {
1113+ } ) if Some ( * hir_id) == pat_id => {
11141114 return LetSource :: IfLetGuard ;
11151115 }
11161116 hir:: Node :: Expr ( hir:: Expr { kind : hir:: ExprKind :: Let ( ..) , span, .. } ) => {
0 commit comments