@@ -223,7 +223,7 @@ pub struct ScopeTree {
223
223
/// The parent of the root body owner, if the latter is an
224
224
/// an associated const or method, as impls/traits can also
225
225
/// have lifetime parameters free in this body.
226
- root_parent : Option < ast :: NodeId > ,
226
+ root_parent : Option < hir :: HirId > ,
227
227
228
228
/// `parent_map` maps from a scope ID to the enclosing scope id;
229
229
/// this is usually corresponding to the lexical nesting, though
@@ -650,8 +650,8 @@ impl<'tcx> ScopeTree {
650
650
-> Scope {
651
651
let param_owner = tcx. parent_def_id ( br. def_id ) . unwrap ( ) ;
652
652
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| {
655
655
tcx. hir ( ) . body ( body_id) . value . hir_id . local_id
656
656
} ) . unwrap_or_else ( || {
657
657
// The lifetime was defined on node that doesn't own a body,
@@ -661,7 +661,7 @@ impl<'tcx> ScopeTree {
661
661
"free_scope: {:?} not recognized by the \
662
662
region scope tree for {:?} / {:?}",
663
663
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) ) ,
665
665
self . root_body. map( |hir_id| DefId :: local( hir_id. owner) ) ) ;
666
666
667
667
// The trait/impl lifetime is in scope for the method's body.
@@ -686,7 +686,7 @@ impl<'tcx> ScopeTree {
686
686
// on the same function that they ended up being freed in.
687
687
assert_eq ! ( param_owner, fr. scope) ;
688
688
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 ( ) ;
690
690
let body_id = tcx. hir ( ) . body_owned_by ( param_owner_id) ;
691
691
Scope { id : tcx. hir ( ) . body ( body_id) . value . hir_id . local_id , data : ScopeData :: CallSite }
692
692
}
@@ -1328,8 +1328,8 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
1328
1328
return tcx. region_scope_tree ( closure_base_def_id) ;
1329
1329
}
1330
1330
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) {
1333
1333
let mut visitor = RegionResolutionVisitor {
1334
1334
tcx,
1335
1335
scope_tree : ScopeTree :: default ( ) ,
@@ -1348,10 +1348,10 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
1348
1348
// If the item is an associated const or a method,
1349
1349
// record its impl/trait parent, as it can also have
1350
1350
// lifetime parameters free in this body.
1351
- match tcx. hir ( ) . get ( id) {
1351
+ match tcx. hir ( ) . get_by_hir_id ( id) {
1352
1352
Node :: ImplItem ( _) |
1353
1353
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) ) ;
1355
1355
}
1356
1356
_ => { }
1357
1357
}
0 commit comments