This repository was archived by the owner on May 28, 2025. It is now read-only.
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> {
11151115 let mut trait_map: FxHashMap < _ , FxHashMap < _ , _ > > = FxHashMap :: default ( ) ;
11161116 for ( hir_id, v) in resolutions. trait_map . into_iter ( ) {
11171117 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 ( ) ;
11221118 map. insert ( hir_id. local_id , StableVec :: new ( v) ) ;
11231119 }
11241120
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ pub struct ResolverOutputs {
121121 pub definitions : rustc_hir:: definitions:: Definitions ,
122122 pub cstore : Box < CrateStoreDyn > ,
123123 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 > > > ,
125125 pub maybe_unused_trait_imports : NodeSet ,
126126 pub maybe_unused_extern_crates : Vec < ( NodeId , Span ) > ,
127127 pub export_map : ExportMap < NodeId > ,
Original file line number Diff line number Diff line change @@ -1273,15 +1273,21 @@ impl<'a> Resolver<'a> {
12731273 }
12741274
12751275 pub fn into_outputs ( self ) -> ResolverOutputs {
1276+ let definitions = self . definitions ;
12761277 let trait_map = {
12771278 let mut map = FxHashMap :: default ( ) ;
12781279 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+ ) ;
12801286 }
12811287 map
12821288 } ;
12831289 ResolverOutputs {
1284- definitions : self . definitions ,
1290+ definitions : definitions,
12851291 cstore : Box :: new ( self . crate_loader . into_cstore ( ) ) ,
12861292 extern_crate_map : self . extern_crate_map ,
12871293 export_map : self . export_map ,
@@ -1306,7 +1312,15 @@ impl<'a> Resolver<'a> {
13061312 trait_map : {
13071313 let mut map = FxHashMap :: default ( ) ;
13081314 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+ ) ;
13101324 }
13111325 map
13121326 } ,
You can’t perform that action at this time.
0 commit comments