@@ -23,7 +23,6 @@ use rustc::util::nodemap::FxHashMap;
2323use rustc_data_structures:: indexed_vec:: { Idx , IndexVec } ;
2424use rustc_errors:: DiagnosticBuilder ;
2525use std:: iter;
26- use syntax:: ast;
2726
2827use super :: ToRegionVid ;
2928
@@ -200,12 +199,10 @@ impl<'tcx> UniversalRegions<'tcx> {
200199 param_env : ty:: ParamEnv < ' tcx > ,
201200 ) -> Self {
202201 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 ( ) ;
205203 UniversalRegionsBuilder {
206204 infcx,
207205 mir_def_id,
208- mir_node_id,
209206 mir_hir_id,
210207 param_env,
211208 } . build ( )
@@ -370,7 +367,6 @@ struct UniversalRegionsBuilder<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
370367 infcx : & ' cx InferCtxt < ' cx , ' gcx , ' tcx > ,
371368 mir_def_id : DefId ,
372369 mir_hir_id : HirId ,
373- mir_node_id : ast:: NodeId ,
374370 param_env : ty:: ParamEnv < ' tcx > ,
375371}
376372
@@ -475,7 +471,7 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
475471 let tcx = self . infcx . tcx ;
476472 let closure_base_def_id = tcx. closure_base_def_id ( self . mir_def_id ) ;
477473
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 ) {
479475 BodyOwnerKind :: Closure |
480476 BodyOwnerKind :: Fn => {
481477 let defining_ty = if self . mir_def_id == closure_base_def_id {
0 commit comments