@@ -223,7 +223,7 @@ pub struct ScopeTree {
223223 /// The parent of the root body owner, if the latter is an
224224 /// an associated const or method, as impls/traits can also
225225 /// have lifetime parameters free in this body.
226- root_parent : Option < ast :: NodeId > ,
226+ root_parent : Option < hir :: HirId > ,
227227
228228 /// `parent_map` maps from a scope ID to the enclosing scope id;
229229 /// this is usually corresponding to the lexical nesting, though
@@ -650,8 +650,8 @@ impl<'tcx> ScopeTree {
650650 -> Scope {
651651 let param_owner = tcx. parent_def_id ( br. def_id ) . unwrap ( ) ;
652652
653- let param_owner_id = tcx. hir ( ) . as_local_node_id ( param_owner) . unwrap ( ) ;
654- let scope = tcx. hir ( ) . maybe_body_owned_by ( param_owner_id) . map ( |body_id| {
653+ let param_owner_id = tcx. hir ( ) . as_local_hir_id ( param_owner) . unwrap ( ) ;
654+ let scope = tcx. hir ( ) . maybe_body_owned_by_by_hir_id ( param_owner_id) . map ( |body_id| {
655655 tcx. hir ( ) . body ( body_id) . value . hir_id . local_id
656656 } ) . unwrap_or_else ( || {
657657 // The lifetime was defined on node that doesn't own a body,
@@ -661,7 +661,7 @@ impl<'tcx> ScopeTree {
661661 "free_scope: {:?} not recognized by the \
662662 region scope tree for {:?} / {:?}",
663663 param_owner,
664- self . root_parent. map( |id| tcx. hir( ) . local_def_id ( id) ) ,
664+ self . root_parent. map( |id| tcx. hir( ) . local_def_id_from_hir_id ( id) ) ,
665665 self . root_body. map( |hir_id| DefId :: local( hir_id. owner) ) ) ;
666666
667667 // The trait/impl lifetime is in scope for the method's body.
@@ -686,7 +686,7 @@ impl<'tcx> ScopeTree {
686686 // on the same function that they ended up being freed in.
687687 assert_eq ! ( param_owner, fr. scope) ;
688688
689- let param_owner_id = tcx. hir ( ) . as_local_node_id ( param_owner) . unwrap ( ) ;
689+ let param_owner_id = tcx. hir ( ) . as_local_hir_id ( param_owner) . unwrap ( ) ;
690690 let body_id = tcx. hir ( ) . body_owned_by ( param_owner_id) ;
691691 Scope { id : tcx. hir ( ) . body ( body_id) . value . hir_id . local_id , data : ScopeData :: CallSite }
692692 }
@@ -1328,8 +1328,8 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
13281328 return tcx. region_scope_tree ( closure_base_def_id) ;
13291329 }
13301330
1331- let id = tcx. hir ( ) . as_local_node_id ( def_id) . unwrap ( ) ;
1332- let scope_tree = if let Some ( body_id) = tcx. hir ( ) . maybe_body_owned_by ( id) {
1331+ let id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1332+ let scope_tree = if let Some ( body_id) = tcx. hir ( ) . maybe_body_owned_by_by_hir_id ( id) {
13331333 let mut visitor = RegionResolutionVisitor {
13341334 tcx,
13351335 scope_tree : ScopeTree :: default ( ) ,
@@ -1348,10 +1348,10 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
13481348 // If the item is an associated const or a method,
13491349 // record its impl/trait parent, as it can also have
13501350 // lifetime parameters free in this body.
1351- match tcx. hir ( ) . get ( id) {
1351+ match tcx. hir ( ) . get_by_hir_id ( id) {
13521352 Node :: ImplItem ( _) |
13531353 Node :: TraitItem ( _) => {
1354- visitor. scope_tree . root_parent = Some ( tcx. hir ( ) . get_parent ( id) ) ;
1354+ visitor. scope_tree . root_parent = Some ( tcx. hir ( ) . get_parent_item ( id) ) ;
13551355 }
13561356 _ => { }
13571357 }
0 commit comments