@@ -768,7 +768,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
768
768
}
769
769
// Different to previous arm because one is `&hir::Local` and the other
770
770
// is `P<hir::Local>`.
771
- hir:: Node :: Local ( local) => get_name ( err, & local. pat . kind ) ,
771
+ hir:: Node :: LetStmt ( local) => get_name ( err, & local. pat . kind ) ,
772
772
_ => None ,
773
773
}
774
774
}
@@ -930,7 +930,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
930
930
let hir:: Node :: Pat ( pat) = self . tcx . hir_node ( hir_id) else {
931
931
return ;
932
932
} ;
933
- let hir:: Node :: Local ( hir:: LetStmt { ty : None , init : Some ( init) , .. } ) =
933
+ let hir:: Node :: LetStmt ( hir:: LetStmt { ty : None , init : Some ( init) , .. } ) =
934
934
self . tcx . parent_hir_node ( pat. hir_id )
935
935
else {
936
936
return ;
@@ -1562,7 +1562,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
1562
1562
if let hir:: ExprKind :: Path ( hir:: QPath :: Resolved ( None , path) ) = expr. kind
1563
1563
&& let Res :: Local ( hir_id) = path. res
1564
1564
&& let hir:: Node :: Pat ( binding) = self . tcx . hir_node ( hir_id)
1565
- && let hir:: Node :: Local ( local) = self . tcx . parent_hir_node ( binding. hir_id )
1565
+ && let hir:: Node :: LetStmt ( local) = self . tcx . parent_hir_node ( binding. hir_id )
1566
1566
&& let None = local. ty
1567
1567
&& let Some ( binding_expr) = local. init
1568
1568
{
@@ -2966,7 +2966,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
2966
2966
err. downgrade_to_delayed_bug ( ) ;
2967
2967
}
2968
2968
match tcx. parent_hir_node ( hir_id) {
2969
- Node :: Local ( hir:: LetStmt { ty : Some ( ty) , .. } ) => {
2969
+ Node :: LetStmt ( hir:: LetStmt { ty : Some ( ty) , .. } ) => {
2970
2970
err. span_suggestion_verbose (
2971
2971
ty. span . shrink_to_lo ( ) ,
2972
2972
"consider borrowing here" ,
@@ -2975,7 +2975,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
2975
2975
) ;
2976
2976
err. note ( "all local variables must have a statically known size" ) ;
2977
2977
}
2978
- Node :: Local ( hir:: LetStmt {
2978
+ Node :: LetStmt ( hir:: LetStmt {
2979
2979
init : Some ( hir:: Expr { kind : hir:: ExprKind :: Index ( ..) , span, .. } ) ,
2980
2980
..
2981
2981
} ) => {
@@ -3867,7 +3867,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
3867
3867
if let hir:: ExprKind :: Path ( hir:: QPath :: Resolved ( None , path) ) = expr. kind
3868
3868
&& let hir:: Path { res : Res :: Local ( hir_id) , .. } = path
3869
3869
&& let hir:: Node :: Pat ( binding) = self . tcx . hir_node ( * hir_id)
3870
- && let hir:: Node :: Local ( local) = self . tcx . parent_hir_node ( binding. hir_id )
3870
+ && let hir:: Node :: LetStmt ( local) = self . tcx . parent_hir_node ( binding. hir_id )
3871
3871
&& let Some ( binding_expr) = local. init
3872
3872
{
3873
3873
// If the expression we're calling on is a binding, we want to point at the
@@ -4128,7 +4128,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
4128
4128
{
4129
4129
let parent = self . tcx . parent_hir_node ( binding. hir_id ) ;
4130
4130
// We've reached the root of the method call chain...
4131
- if let hir:: Node :: Local ( local) = parent
4131
+ if let hir:: Node :: LetStmt ( local) = parent
4132
4132
&& let Some ( binding_expr) = local. init
4133
4133
{
4134
4134
// ...and it is a binding. Get the binding creation and continue the chain.
0 commit comments