Skip to content

Commit 75ad81c

Browse files
committed
Do not store stable_crate_id again in Definitions.
1 parent 027fa9e commit 75ad81c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/rustc_hir/src/definitions.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ impl DefPathTable {
103103
pub struct Definitions {
104104
table: DefPathTable,
105105
next_disambiguator: UnordMap<(LocalDefId, DefPathData), u32>,
106-
107-
/// The [StableCrateId] of the local crate.
108-
stable_crate_id: StableCrateId,
109106
}
110107

111108
/// A unique identifier that we can use to lookup a definition
@@ -340,7 +337,7 @@ impl Definitions {
340337
let root = LocalDefId { local_def_index: table.allocate(key, def_path_hash) };
341338
assert_eq!(root.local_def_index, CRATE_DEF_INDEX);
342339

343-
Definitions { table, next_disambiguator: Default::default(), stable_crate_id }
340+
Definitions { table, next_disambiguator: Default::default() }
344341
}
345342

346343
/// Adds a definition with a parent definition.
@@ -382,7 +379,7 @@ impl Definitions {
382379
hash: DefPathHash,
383380
err: &mut dyn FnMut() -> !,
384381
) -> LocalDefId {
385-
debug_assert!(hash.stable_crate_id() == self.stable_crate_id);
382+
debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id);
386383
self.table
387384
.def_path_hash_to_index
388385
.get(&hash)

0 commit comments

Comments
 (0)