@@ -318,7 +318,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
318
318
) ;
319
319
expr_id = parent_id;
320
320
}
321
- Node :: Local ( local) => {
321
+ Node :: LetStmt ( local) => {
322
322
if let Some ( mut ty) = local. ty {
323
323
while let Some ( index) = tuple_indexes. pop ( ) {
324
324
match ty. kind {
@@ -1331,7 +1331,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1331
1331
// ++++++++++
1332
1332
// since the user probably just misunderstood how `let else`
1333
1333
// and `&&` work together.
1334
- if let Some ( ( _, hir:: Node :: Local ( local) ) ) = cond_parent
1334
+ if let Some ( ( _, hir:: Node :: LetStmt ( local) ) ) = cond_parent
1335
1335
&& let hir:: PatKind :: Path ( qpath) | hir:: PatKind :: TupleStruct ( qpath, _, _) =
1336
1336
& local. pat . kind
1337
1337
&& let hir:: QPath :: Resolved ( None , path) = qpath
@@ -1731,7 +1731,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1731
1731
1732
1732
match self . tcx . parent_hir_node ( * hir_id) {
1733
1733
// foo.clone()
1734
- hir:: Node :: Local ( hir:: LetStmt { init : Some ( init) , .. } ) => {
1734
+ hir:: Node :: LetStmt ( hir:: LetStmt { init : Some ( init) , .. } ) => {
1735
1735
self . note_type_is_not_clone_inner_expr ( init)
1736
1736
}
1737
1737
// When `expr` is more complex like a tuple
@@ -1740,7 +1740,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1740
1740
kind : hir:: PatKind :: Tuple ( pats, ..) ,
1741
1741
..
1742
1742
} ) => {
1743
- let hir:: Node :: Local ( hir:: LetStmt { init : Some ( init) , .. } ) =
1743
+ let hir:: Node :: LetStmt ( hir:: LetStmt { init : Some ( init) , .. } ) =
1744
1744
self . tcx . parent_hir_node ( * pat_hir_id)
1745
1745
else {
1746
1746
return expr;
@@ -1774,7 +1774,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1774
1774
&& let hir:: Path { segments : [ _] , res : crate :: Res :: Local ( binding) , .. } =
1775
1775
call_expr_path
1776
1776
&& let hir:: Node :: Pat ( hir:: Pat { hir_id, .. } ) = self . tcx . hir_node ( * binding)
1777
- && let hir:: Node :: Local ( hir:: LetStmt { init : Some ( init) , .. } ) =
1777
+ && let hir:: Node :: LetStmt ( hir:: LetStmt { init : Some ( init) , .. } ) =
1778
1778
self . tcx . parent_hir_node ( * hir_id)
1779
1779
&& let Expr {
1780
1780
kind : hir:: ExprKind :: Closure ( hir:: Closure { body : body_id, .. } ) ,
@@ -3134,7 +3134,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3134
3134
let hir:: Node :: Pat ( pat) = self . tcx . hir_node ( hir_id) else {
3135
3135
return ;
3136
3136
} ;
3137
- let hir:: Node :: Local ( hir:: LetStmt { ty : None , init : Some ( init) , .. } ) =
3137
+ let hir:: Node :: LetStmt ( hir:: LetStmt { ty : None , init : Some ( init) , .. } ) =
3138
3138
self . tcx . parent_hir_node ( pat. hir_id )
3139
3139
else {
3140
3140
return ;
0 commit comments