@@ -1437,7 +1437,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1437
1437
let Some ( hir_generics) = tcx
1438
1438
. typeck_root_def_id ( self . mir_def_id ( ) . to_def_id ( ) )
1439
1439
. as_local ( )
1440
- . and_then ( |def_id| tcx. hir ( ) . get_generics ( def_id) )
1440
+ . and_then ( |def_id| tcx. hir_get_generics ( def_id) )
1441
1441
else {
1442
1442
return ;
1443
1443
} ;
@@ -1889,7 +1889,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1889
1889
1890
1890
fn suggest_copy_for_type_in_cloned_ref ( & self , err : & mut Diag < ' infcx > , place : Place < ' tcx > ) {
1891
1891
let tcx = self . infcx . tcx ;
1892
- let hir = tcx. hir ( ) ;
1893
1892
let Some ( body_id) = tcx. hir_node ( self . mir_hir_id ( ) ) . body_id ( ) else { return } ;
1894
1893
1895
1894
struct FindUselessClone < ' tcx > {
@@ -1917,7 +1916,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1917
1916
1918
1917
let mut expr_finder = FindUselessClone :: new ( tcx, self . mir_def_id ( ) ) ;
1919
1918
1920
- let body = hir . body ( body_id) . value ;
1919
+ let body = tcx . hir_body ( body_id) . value ;
1921
1920
expr_finder. visit_expr ( body) ;
1922
1921
1923
1922
struct Holds < ' tcx > {
@@ -2106,7 +2105,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
2106
2105
let tcx = self . infcx . tcx ;
2107
2106
let body_id = tcx. hir_node ( self . mir_hir_id ( ) ) . body_id ( ) ?;
2108
2107
let mut expr_finder = FindExprBySpan :: new ( span, tcx) ;
2109
- expr_finder. visit_expr ( tcx. hir ( ) . body ( body_id) . value ) ;
2108
+ expr_finder. visit_expr ( tcx. hir_body ( body_id) . value ) ;
2110
2109
expr_finder. result
2111
2110
}
2112
2111
@@ -2258,7 +2257,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
2258
2257
) {
2259
2258
let issue_span = issued_spans. args_or_use ( ) ;
2260
2259
let tcx = self . infcx . tcx ;
2261
- let hir = tcx. hir ( ) ;
2262
2260
2263
2261
let Some ( body_id) = tcx. hir_node ( self . mir_hir_id ( ) ) . body_id ( ) else { return } ;
2264
2262
let typeck_results = tcx. typeck ( self . mir_def_id ( ) ) ;
@@ -2346,7 +2344,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
2346
2344
pat_span : None ,
2347
2345
head : None ,
2348
2346
} ;
2349
- finder. visit_expr ( hir . body ( body_id) . value ) ;
2347
+ finder. visit_expr ( tcx . hir_body ( body_id) . value ) ;
2350
2348
2351
2349
if let Some ( body_expr) = finder. body_expr
2352
2350
&& let Some ( loop_span) = finder. loop_span
@@ -2454,7 +2452,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
2454
2452
// Get the body the error happens in
2455
2453
let Some ( body_id) = tcx. hir_node ( self . mir_hir_id ( ) ) . body_id ( ) else { return } ;
2456
2454
2457
- let body_expr = hir . body ( body_id) . value ;
2455
+ let body_expr = tcx . hir_body ( body_id) . value ;
2458
2456
2459
2457
struct ClosureFinder < ' hir > {
2460
2458
hir : rustc_middle:: hir:: map:: Map < ' hir > ,
@@ -2558,7 +2556,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
2558
2556
}
2559
2557
2560
2558
let mut finder = VariableUseFinder { local_id, spans : Vec :: new ( ) } ;
2561
- finder. visit_expr ( hir . body ( closure. body ) . value ) ;
2559
+ finder. visit_expr ( tcx . hir_body ( closure. body ) . value ) ;
2562
2560
2563
2561
spans = finder. spans ;
2564
2562
} else {
@@ -3211,7 +3209,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
3211
3209
if let Some ( scope) = self . body . source_scopes . get ( source_info. scope )
3212
3210
&& let ClearCrossCrate :: Set ( scope_data) = & scope. local_data
3213
3211
&& let Some ( id) = self . infcx . tcx . hir_node ( scope_data. lint_root ) . body_id ( )
3214
- && let hir:: ExprKind :: Block ( block, _) = self . infcx . tcx . hir ( ) . body ( id) . value . kind
3212
+ && let hir:: ExprKind :: Block ( block, _) = self . infcx . tcx . hir_body ( id) . value . kind
3215
3213
{
3216
3214
for stmt in block. stmts {
3217
3215
let mut visitor = NestedStatementVisitor {
0 commit comments