@@ -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 } ;
@@ -879,7 +879,7 @@ pub struct Resolver<'a> {
879
879
/// `CrateNum` resolutions of `extern crate` items.
880
880
extern_crate_map : FxHashMap < LocalDefId , CrateNum > ,
881
881
export_map : ExportMap < LocalDefId > ,
882
- trait_map : TraitMap < NodeId > ,
882
+ trait_map : NodeMap < Vec < TraitCandidate > > ,
883
883
884
884
/// A map from nodes to anonymous modules.
885
885
/// Anonymous modules are pseudo-modules that are implicitly created around items
@@ -1285,14 +1285,7 @@ impl<'a> Resolver<'a> {
1285
1285
let trait_map = self
1286
1286
. trait_map
1287
1287
. 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) )
1296
1289
. collect ( ) ;
1297
1290
let maybe_unused_trait_imports = self . maybe_unused_trait_imports ;
1298
1291
let maybe_unused_extern_crates = self . maybe_unused_extern_crates ;
@@ -1323,17 +1316,7 @@ impl<'a> Resolver<'a> {
1323
1316
trait_map : self
1324
1317
. trait_map
1325
1318
. 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 ( ) ) )
1337
1320
. collect ( ) ,
1338
1321
glob_map : self . glob_map . clone ( ) ,
1339
1322
maybe_unused_trait_imports : self . maybe_unused_trait_imports . clone ( ) ,
0 commit comments