Skip to content

Commit 58a9c73

Browse files
committed
Make the HIR map own the Definitions.
1 parent 144d1c2 commit 58a9c73

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc/hir/map/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub struct Map<'hir> {
200200

201201
map: HirEntryMap<'hir>,
202202

203-
definitions: &'hir Definitions,
203+
definitions: Definitions,
204204

205205
/// The reverse mapping of `node_to_hir_id`.
206206
hir_to_node_id: FxHashMap<HirId, NodeId>,
@@ -267,8 +267,8 @@ impl<'hir> Map<'hir> {
267267
}
268268

269269
#[inline]
270-
pub fn definitions(&self) -> &'hir Definitions {
271-
self.definitions
270+
pub fn definitions(&self) -> &Definitions {
271+
&self.definitions
272272
}
273273

274274
pub fn def_key(&self, def_id: DefId) -> DefKey {
@@ -1251,7 +1251,7 @@ impl Named for ImplItem { fn name(&self) -> Name { self.ident.name } }
12511251
pub fn map_crate<'hir>(sess: &crate::session::Session,
12521252
cstore: &CrateStoreDyn,
12531253
forest: &'hir Forest,
1254-
definitions: &'hir Definitions)
1254+
definitions: Definitions)
12551255
-> Map<'hir> {
12561256
let _prof_timer = sess.prof.generic_activity("build_hir_map");
12571257

@@ -1260,7 +1260,7 @@ pub fn map_crate<'hir>(sess: &crate::session::Session,
12601260
.map(|(node_id, &hir_id)| (hir_id, node_id)).collect();
12611261

12621262
let (map, crate_hash) = {
1263-
let hcx = crate::ich::StableHashingContext::new(sess, &forest.krate, definitions, cstore);
1263+
let hcx = crate::ich::StableHashingContext::new(sess, &forest.krate, &definitions, cstore);
12641264

12651265
let mut collector = NodeCollector::root(sess,
12661266
&forest.krate,

src/librustc_interface/passes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ pub fn create_global_ctxt(
777777

778778
// Construct the HIR map.
779779
let hir_map = time(sess, "indexing HIR", || {
780-
hir::map::map_crate(sess, &*resolver_outputs.cstore, &mut hir_forest, &defs)
780+
hir::map::map_crate(sess, &*resolver_outputs.cstore, &mut hir_forest, defs)
781781
});
782782

783783
let query_result_on_disk_cache = time(sess, "load query result cache", || {

0 commit comments

Comments
 (0)