@@ -38,7 +38,7 @@ use rustc_hir::def::{self, CtorOf, DefKind, NonMacroAttrKind, PartialRes};
38
38
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LocalDefId , CRATE_DEF_INDEX } ;
39
39
use rustc_hir:: definitions:: { DefKey , Definitions } ;
40
40
use rustc_hir:: PrimTy :: { self , Bool , Char , Float , Int , Str , Uint } ;
41
- use rustc_hir:: TraitMap ;
41
+ use rustc_hir:: TraitCandidate ;
42
42
use rustc_metadata:: creader:: { CStore , CrateLoader } ;
43
43
use rustc_middle:: hir:: exports:: ExportMap ;
44
44
use rustc_middle:: middle:: cstore:: { CrateStore , MetadataLoaderDyn } ;
@@ -881,7 +881,7 @@ pub struct Resolver<'a> {
881
881
/// `CrateNum` resolutions of `extern crate` items.
882
882
extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
883
883
export_map : ExportMap < LocalDefId > ,
884
- trait_map : TraitMap < NodeId > ,
884
+ trait_map : NodeMap < Vec < TraitCandidate > > ,
885
885
886
886
/// A map from nodes to anonymous modules.
887
887
/// Anonymous modules are pseudo-modules that are implicitly created around items
@@ -1287,14 +1287,7 @@ impl<'a> Resolver<'a> {
1287
1287
let trait_map = self
1288
1288
. trait_map
1289
1289
. 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) )
1298
1291
. collect ( ) ;
1299
1292
let maybe_unused_trait_imports = self . maybe_unused_trait_imports ;
1300
1293
let maybe_unused_extern_crates = self . maybe_unused_extern_crates ;
@@ -1325,17 +1318,7 @@ impl<'a> Resolver<'a> {
1325
1318
trait_map : self
1326
1319
. trait_map
1327
1320
. 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 ( ) ) )
1339
1322
. collect ( ) ,
1340
1323
glob_map : self . glob_map . clone ( ) ,
1341
1324
maybe_unused_trait_imports : self . maybe_unused_trait_imports . clone ( ) ,
0 commit comments