@@ -5,6 +5,7 @@ pub use self::definitions::{
55
66use crate :: arena:: Arena ;
77use crate :: dep_graph:: { DepGraph , DepKind , DepNode , DepNodeIndex } ;
8+ use crate :: hir:: { HirOwner , HirOwnerItems } ;
89use crate :: middle:: cstore:: CrateStoreDyn ;
910use crate :: ty:: query:: Providers ;
1011use rustc_data_structures:: fx:: FxHashMap ;
@@ -146,6 +147,9 @@ pub struct Map<'hir> {
146147 /// The SVH of the local crate.
147148 pub crate_hash : Svh ,
148149
150+ pub ( super ) owner_map : FxHashMap < DefIndex , & ' hir HirOwner < ' hir > > ,
151+ pub ( super ) owner_items_map : FxHashMap < DefIndex , & ' hir HirOwnerItems < ' hir > > ,
152+
149153 map : HirEntryMap < ' hir > ,
150154
151155 definitions : Definitions ,
@@ -1222,7 +1226,7 @@ pub fn map_crate<'hir>(
12221226 . map ( |( node_id, & hir_id) | ( hir_id, node_id) )
12231227 . collect ( ) ;
12241228
1225- let ( map, crate_hash) = {
1229+ let ( map, owner_map , owner_items_map , crate_hash) = {
12261230 let hcx = crate :: ich:: StableHashingContext :: new ( sess, krate, & definitions, cstore) ;
12271231
12281232 let mut collector =
@@ -1234,7 +1238,16 @@ pub fn map_crate<'hir>(
12341238 collector. finalize_and_compute_crate_hash ( crate_disambiguator, cstore, cmdline_args)
12351239 } ;
12361240
1237- let map = Map { krate, dep_graph, crate_hash, map, hir_to_node_id, definitions } ;
1241+ let map = Map {
1242+ krate,
1243+ dep_graph,
1244+ crate_hash,
1245+ map,
1246+ owner_map,
1247+ owner_items_map : owner_items_map. into_iter ( ) . map ( |( k, v) | ( k, & * v) ) . collect ( ) ,
1248+ hir_to_node_id,
1249+ definitions,
1250+ } ;
12381251
12391252 sess. time ( "validate_HIR_map" , || {
12401253 hir_id_validator:: check_crate ( & map) ;
0 commit comments