@@ -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 } ;
@@ -881,7 +881,7 @@ pub struct Resolver<'a> {
881881 /// `CrateNum` resolutions of `extern crate` items.
882882 extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
883883 export_map : ExportMap < LocalDefId > ,
884- trait_map : TraitMap < NodeId > ,
884+ trait_map : NodeMap < Vec < TraitCandidate > > ,
885885
886886 /// A map from nodes to anonymous modules.
887887 /// Anonymous modules are pseudo-modules that are implicitly created around items
@@ -1287,14 +1287,7 @@ impl<'a> Resolver<'a> {
12871287 let trait_map = self
12881288 . trait_map
12891289 . into_iter ( )
1290- . map ( |( k, v) | {
1291- (
1292- definitions. node_id_to_hir_id ( k) ,
1293- v. into_iter ( )
1294- . map ( |tc| tc. map_import_ids ( |id| definitions. node_id_to_hir_id ( id) ) )
1295- . collect ( ) ,
1296- )
1297- } )
1290+ . map ( |( k, v) | ( definitions. node_id_to_hir_id ( k) , v) )
12981291 . collect ( ) ;
12991292 let maybe_unused_trait_imports = self . maybe_unused_trait_imports ;
13001293 let maybe_unused_extern_crates = self . maybe_unused_extern_crates ;
@@ -1325,17 +1318,7 @@ impl<'a> Resolver<'a> {
13251318 trait_map : self
13261319 . trait_map
13271320 . iter ( )
1328- . map ( |( & k, v) | {
1329- (
1330- self . definitions . node_id_to_hir_id ( k) ,
1331- v. iter ( )
1332- . cloned ( )
1333- . map ( |tc| {
1334- tc. map_import_ids ( |id| self . definitions . node_id_to_hir_id ( id) )
1335- } )
1336- . collect ( ) ,
1337- )
1338- } )
1321+ . map ( |( & k, v) | ( self . definitions . node_id_to_hir_id ( k) , v. clone ( ) ) )
13391322 . collect ( ) ,
13401323 glob_map : self . glob_map . clone ( ) ,
13411324 maybe_unused_trait_imports : self . maybe_unused_trait_imports . clone ( ) ,
0 commit comments