@@ -5,6 +5,7 @@ pub use self::definitions::{
5
5
6
6
use crate :: arena:: Arena ;
7
7
use crate :: dep_graph:: { DepGraph , DepKind , DepNode , DepNodeIndex } ;
8
+ use crate :: hir:: { HirOwner , HirOwnerItems } ;
8
9
use crate :: middle:: cstore:: CrateStoreDyn ;
9
10
use crate :: ty:: query:: Providers ;
10
11
use rustc_data_structures:: fx:: FxHashMap ;
@@ -146,6 +147,9 @@ pub struct Map<'hir> {
146
147
/// The SVH of the local crate.
147
148
pub crate_hash : Svh ,
148
149
150
+ pub ( super ) owner_map : FxHashMap < DefIndex , & ' hir HirOwner < ' hir > > ,
151
+ pub ( super ) owner_items_map : FxHashMap < DefIndex , & ' hir HirOwnerItems < ' hir > > ,
152
+
149
153
map : HirEntryMap < ' hir > ,
150
154
151
155
definitions : Definitions ,
@@ -1222,7 +1226,7 @@ pub fn map_crate<'hir>(
1222
1226
. map ( |( node_id, & hir_id) | ( hir_id, node_id) )
1223
1227
. collect ( ) ;
1224
1228
1225
- let ( map, crate_hash) = {
1229
+ let ( map, owner_map , owner_items_map , crate_hash) = {
1226
1230
let hcx = crate :: ich:: StableHashingContext :: new ( sess, krate, & definitions, cstore) ;
1227
1231
1228
1232
let mut collector =
@@ -1234,7 +1238,16 @@ pub fn map_crate<'hir>(
1234
1238
collector. finalize_and_compute_crate_hash ( crate_disambiguator, cstore, cmdline_args)
1235
1239
} ;
1236
1240
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
+ } ;
1238
1251
1239
1252
sess. time ( "validate_HIR_map" , || {
1240
1253
hir_id_validator:: check_crate ( & map) ;
0 commit comments