@@ -23,7 +23,6 @@ use rustc::util::nodemap::FxHashMap;
23
23
use rustc_data_structures:: indexed_vec:: { Idx , IndexVec } ;
24
24
use rustc_errors:: DiagnosticBuilder ;
25
25
use std:: iter;
26
- use syntax:: ast;
27
26
28
27
use super :: ToRegionVid ;
29
28
@@ -200,12 +199,10 @@ impl<'tcx> UniversalRegions<'tcx> {
200
199
param_env : ty:: ParamEnv < ' tcx > ,
201
200
) -> Self {
202
201
let tcx = infcx. tcx ;
203
- let mir_node_id = tcx. hir ( ) . as_local_node_id ( mir_def_id) . unwrap ( ) ;
204
- let mir_hir_id = tcx. hir ( ) . node_to_hir_id ( mir_node_id) ;
202
+ let mir_hir_id = tcx. hir ( ) . as_local_hir_id ( mir_def_id) . unwrap ( ) ;
205
203
UniversalRegionsBuilder {
206
204
infcx,
207
205
mir_def_id,
208
- mir_node_id,
209
206
mir_hir_id,
210
207
param_env,
211
208
} . build ( )
@@ -370,7 +367,6 @@ struct UniversalRegionsBuilder<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
370
367
infcx : & ' cx InferCtxt < ' cx , ' gcx , ' tcx > ,
371
368
mir_def_id : DefId ,
372
369
mir_hir_id : HirId ,
373
- mir_node_id : ast:: NodeId ,
374
370
param_env : ty:: ParamEnv < ' tcx > ,
375
371
}
376
372
@@ -475,7 +471,7 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
475
471
let tcx = self . infcx . tcx ;
476
472
let closure_base_def_id = tcx. closure_base_def_id ( self . mir_def_id ) ;
477
473
478
- match tcx. hir ( ) . body_owner_kind ( self . mir_node_id ) {
474
+ match tcx. hir ( ) . body_owner_kind_by_hir_id ( self . mir_hir_id ) {
479
475
BodyOwnerKind :: Closure |
480
476
BodyOwnerKind :: Fn => {
481
477
let defining_ty = if self . mir_def_id == closure_base_def_id {
0 commit comments