@@ -55,7 +55,7 @@ use rustc_data_structures::stable_hasher::{
5555use rustc_data_structures:: sync:: { self , Lock , Lrc , WorkerLocal } ;
5656use rustc_hir as hir;
5757use rustc_hir:: def:: { DefKind , Res } ;
58- use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet , DefIndex , LOCAL_CRATE } ;
58+ use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet , LocalDefId , LOCAL_CRATE } ;
5959use rustc_hir:: { HirId , Node , TraitCandidate } ;
6060use rustc_hir:: { ItemKind , ItemLocalId , ItemLocalMap , ItemLocalSet } ;
6161use rustc_index:: vec:: { Idx , IndexVec } ;
@@ -958,7 +958,7 @@ pub struct GlobalCtxt<'tcx> {
958958
959959 /// Map indicating what traits are in scope for places where this
960960 /// is relevant; generated by resolve.
961- trait_map : FxHashMap < DefIndex , FxHashMap < ItemLocalId , StableVec < TraitCandidate > > > ,
961+ trait_map : FxHashMap < LocalDefId , FxHashMap < ItemLocalId , StableVec < TraitCandidate > > > ,
962962
963963 /// Export map produced by name resolution.
964964 export_map : FxHashMap < DefId , Vec < Export < hir:: HirId > > > ,
@@ -1153,7 +1153,7 @@ impl<'tcx> TyCtxt<'tcx> {
11531153 let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
11541154 for ( k, v) in resolutions. trait_map {
11551155 let hir_id = definitions. node_to_hir_id ( k) ;
1156- let map = trait_map. entry ( hir_id. owner ) . or_default ( ) ;
1156+ let map = trait_map. entry ( hir_id. owner_local_def_id ( ) ) . or_default ( ) ;
11571157 let v = v
11581158 . into_iter ( )
11591159 . map ( |tc| tc. map_import_ids ( |id| definitions. node_to_hir_id ( id) ) )
@@ -2631,19 +2631,22 @@ impl<'tcx> TyCtxt<'tcx> {
26312631 }
26322632
26332633 pub fn in_scope_traits ( self , id : HirId ) -> Option < & ' tcx StableVec < TraitCandidate > > {
2634- self . in_scope_traits_map ( id. owner ) . and_then ( |map| map. get ( & id. local_id ) )
2634+ self . in_scope_traits_map ( id. owner_local_def_id ( ) ) . and_then ( |map| map. get ( & id. local_id ) )
26352635 }
26362636
26372637 pub fn named_region ( self , id : HirId ) -> Option < resolve_lifetime:: Region > {
2638- self . named_region_map ( id. owner ) . and_then ( |map| map. get ( & id. local_id ) . cloned ( ) )
2638+ self . named_region_map ( id. owner_local_def_id ( ) )
2639+ . and_then ( |map| map. get ( & id. local_id ) . cloned ( ) )
26392640 }
26402641
26412642 pub fn is_late_bound ( self , id : HirId ) -> bool {
2642- self . is_late_bound_map ( id. owner ) . map ( |set| set. contains ( & id. local_id ) ) . unwrap_or ( false )
2643+ self . is_late_bound_map ( id. owner_local_def_id ( ) )
2644+ . map ( |set| set. contains ( & id. local_id ) )
2645+ . unwrap_or ( false )
26432646 }
26442647
26452648 pub fn object_lifetime_defaults ( self , id : HirId ) -> Option < & ' tcx [ ObjectLifetimeDefault ] > {
2646- self . object_lifetime_defaults_map ( id. owner )
2649+ self . object_lifetime_defaults_map ( id. owner_local_def_id ( ) )
26472650 . and_then ( |map| map. get ( & id. local_id ) . map ( |v| & * * v) )
26482651 }
26492652}
0 commit comments