@@ -38,7 +38,7 @@ use rustc_hir::def::{self, CtorOf, DefKind, NonMacroAttrKind, PartialRes};
3838use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LocalDefId , CRATE_DEF_INDEX } ;
3939use rustc_hir:: definitions:: { DefKey , Definitions } ;
4040use rustc_hir:: PrimTy :: { self , Bool , Char , Float , Int , Str , Uint } ;
41- use rustc_hir:: TraitMap ;
41+ use rustc_hir:: TraitCandidate ;
4242use rustc_metadata:: creader:: { CStore , CrateLoader } ;
4343use rustc_middle:: hir:: exports:: ExportMap ;
4444use rustc_middle:: middle:: cstore:: { CrateStore , MetadataLoaderDyn } ;
@@ -879,7 +879,7 @@ pub struct Resolver<'a> {
879879 /// `CrateNum` resolutions of `extern crate` items.
880880 extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
881881 export_map : ExportMap < LocalDefId > ,
882- trait_map : TraitMap < NodeId > ,
882+ trait_map : NodeMap < Vec < TraitCandidate > > ,
883883
884884 /// A map from nodes to anonymous modules.
885885 /// Anonymous modules are pseudo-modules that are implicitly created around items
@@ -1285,14 +1285,7 @@ impl<'a> Resolver<'a> {
12851285 let trait_map = self
12861286 . trait_map
12871287 . into_iter ( )
1288- . map ( |( k, v) | {
1289- (
1290- definitions. node_id_to_hir_id ( k) ,
1291- v. into_iter ( )
1292- . map ( |tc| tc. map_import_ids ( |id| definitions. node_id_to_hir_id ( id) ) )
1293- . collect ( ) ,
1294- )
1295- } )
1288+ . map ( |( k, v) | ( definitions. node_id_to_hir_id ( k) , v) )
12961289 . collect ( ) ;
12971290 let maybe_unused_trait_imports = self . maybe_unused_trait_imports ;
12981291 let maybe_unused_extern_crates = self . maybe_unused_extern_crates ;
@@ -1323,17 +1316,7 @@ impl<'a> Resolver<'a> {
13231316 trait_map : self
13241317 . trait_map
13251318 . iter ( )
1326- . map ( |( & k, v) | {
1327- (
1328- self . definitions . node_id_to_hir_id ( k) ,
1329- v. iter ( )
1330- . cloned ( )
1331- . map ( |tc| {
1332- tc. map_import_ids ( |id| self . definitions . node_id_to_hir_id ( id) )
1333- } )
1334- . collect ( ) ,
1335- )
1336- } )
1319+ . map ( |( & k, v) | ( self . definitions . node_id_to_hir_id ( k) , v. clone ( ) ) )
13371320 . collect ( ) ,
13381321 glob_map : self . glob_map . clone ( ) ,
13391322 maybe_unused_trait_imports : self . maybe_unused_trait_imports . clone ( ) ,
0 commit comments