@@ -10,7 +10,7 @@ use crate::session::config::CrateType;
1010use crate :: middle;
1111use crate :: hir:: { self , TraitCandidate , HirId , ItemKind , ItemLocalId , Node } ;
1212use crate :: hir:: def:: { Res , DefKind , Export } ;
13- use crate :: hir:: def_id:: { CrateNum , DefId , DefIndex , LOCAL_CRATE } ;
13+ use crate :: hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE , LocalDefId } ;
1414use crate :: hir:: map as hir_map;
1515use crate :: hir:: map:: DefPathHash ;
1616use crate :: lint:: { self , Lint } ;
@@ -1054,7 +1054,7 @@ pub struct GlobalCtxt<'tcx> {
10541054
10551055 /// Map indicating what traits are in scope for places where this
10561056 /// is relevant; generated by resolve.
1057- trait_map : FxHashMap < DefIndex ,
1057+ trait_map : FxHashMap < LocalDefId ,
10581058 FxHashMap < ItemLocalId ,
10591059 StableVec < TraitCandidate > > > ,
10601060
@@ -1248,7 +1248,7 @@ impl<'tcx> TyCtxt<'tcx> {
12481248 let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
12491249 for ( k, v) in resolutions. trait_map {
12501250 let hir_id = hir. node_to_hir_id ( k) ;
1251- let map = trait_map. entry ( hir_id. owner ) . or_default ( ) ;
1251+ let map = trait_map. entry ( hir_id. owner_local_def_id ( ) ) . or_default ( ) ;
12521252 map. insert ( hir_id. local_id , StableVec :: new ( v) ) ;
12531253 }
12541254
@@ -2868,23 +2868,23 @@ impl<'tcx> TyCtxt<'tcx> {
28682868 }
28692869
28702870 pub fn in_scope_traits ( self , id : HirId ) -> Option < & ' tcx StableVec < TraitCandidate > > {
2871- self . in_scope_traits_map ( id. owner )
2871+ self . in_scope_traits_map ( id. owner_local_def_id ( ) )
28722872 . and_then ( |map| map. get ( & id. local_id ) )
28732873 }
28742874
28752875 pub fn named_region ( self , id : HirId ) -> Option < resolve_lifetime:: Region > {
2876- self . named_region_map ( id. owner )
2876+ self . named_region_map ( id. owner_local_def_id ( ) )
28772877 . and_then ( |map| map. get ( & id. local_id ) . cloned ( ) )
28782878 }
28792879
28802880 pub fn is_late_bound ( self , id : HirId ) -> bool {
2881- self . is_late_bound_map ( id. owner )
2881+ self . is_late_bound_map ( id. owner_local_def_id ( ) )
28822882 . map ( |set| set. contains ( & id. local_id ) )
28832883 . unwrap_or ( false )
28842884 }
28852885
28862886 pub fn object_lifetime_defaults ( self , id : HirId ) -> Option < & ' tcx [ ObjectLifetimeDefault ] > {
2887- self . object_lifetime_defaults_map ( id. owner )
2887+ self . object_lifetime_defaults_map ( id. owner_local_def_id ( ) )
28882888 . and_then ( |map| map. get ( & id. local_id ) . map ( |v| & * * v) )
28892889 }
28902890}
0 commit comments