File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -1115,10 +1115,6 @@ impl<'tcx> TyCtxt<'tcx> {
1115
1115
let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
1116
1116
for ( hir_id, v) in resolutions. trait_map . into_iter ( ) {
1117
1117
let map = trait_map. entry ( hir_id. owner ) . or_default ( ) ;
1118
- let v = v
1119
- . into_iter ( )
1120
- . map ( |tc| tc. map_import_ids ( |id| definitions. node_id_to_hir_id ( id) ) )
1121
- . collect ( ) ;
1122
1118
map. insert ( hir_id. local_id , StableVec :: new ( v) ) ;
1123
1119
}
1124
1120
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ pub struct ResolverOutputs {
121
121
pub definitions : rustc_hir:: definitions:: Definitions ,
122
122
pub cstore : Box < CrateStoreDyn > ,
123
123
pub extern_crate_map : NodeMap < CrateNum > ,
124
- pub trait_map : FxHashMap < hir:: HirId , Vec < hir:: TraitCandidate < NodeId > > > ,
124
+ pub trait_map : FxHashMap < hir:: HirId , Vec < hir:: TraitCandidate < hir :: HirId > > > ,
125
125
pub maybe_unused_trait_imports : NodeSet ,
126
126
pub maybe_unused_extern_crates : Vec < ( NodeId , Span ) > ,
127
127
pub export_map : ExportMap < NodeId > ,
Original file line number Diff line number Diff line change @@ -1273,15 +1273,21 @@ impl<'a> Resolver<'a> {
1273
1273
}
1274
1274
1275
1275
pub fn into_outputs ( self ) -> ResolverOutputs {
1276
+ let definitions = self . definitions ;
1276
1277
let trait_map = {
1277
1278
let mut map = FxHashMap :: default ( ) ;
1278
1279
for ( k, v) in self . trait_map . into_iter ( ) {
1279
- map. insert ( self . definitions . node_id_to_hir_id ( k) , v) ;
1280
+ map. insert (
1281
+ definitions. node_id_to_hir_id ( k) ,
1282
+ v. into_iter ( )
1283
+ . map ( |tc| tc. map_import_ids ( |id| definitions. node_id_to_hir_id ( id) ) )
1284
+ . collect ( ) ,
1285
+ ) ;
1280
1286
}
1281
1287
map
1282
1288
} ;
1283
1289
ResolverOutputs {
1284
- definitions : self . definitions ,
1290
+ definitions : definitions,
1285
1291
cstore : Box :: new ( self . crate_loader . into_cstore ( ) ) ,
1286
1292
extern_crate_map : self . extern_crate_map ,
1287
1293
export_map : self . export_map ,
@@ -1306,7 +1312,15 @@ impl<'a> Resolver<'a> {
1306
1312
trait_map : {
1307
1313
let mut map = FxHashMap :: default ( ) ;
1308
1314
for ( k, v) in self . trait_map . iter ( ) {
1309
- map. insert ( self . definitions . node_id_to_hir_id ( k. clone ( ) ) , v. clone ( ) ) ;
1315
+ map. insert (
1316
+ self . definitions . node_id_to_hir_id ( k. clone ( ) ) ,
1317
+ v. iter ( )
1318
+ . map ( |tc| {
1319
+ tc. clone ( )
1320
+ . map_import_ids ( |id| self . definitions . node_id_to_hir_id ( id) )
1321
+ } )
1322
+ . collect ( ) ,
1323
+ ) ;
1310
1324
}
1311
1325
map
1312
1326
} ,
You can’t perform that action at this time.
0 commit comments