Skip to content

Commit 62b611e

Browse files
committed
Do not store stable_crate_id again in Definitions.
1 parent ab976a4 commit 62b611e

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
@@ -342,7 +339,7 @@ impl Definitions {
342339
let root = LocalDefId { local_def_index: table.allocate(key, def_path_hash) };
343340
assert_eq!(root.local_def_index, CRATE_DEF_INDEX);
344341

345-
Definitions { table, next_disambiguator: Default::default(), stable_crate_id }
342+
Definitions { table, next_disambiguator: Default::default() }
346343
}
347344

348345
/// Adds a definition with a parent definition.
@@ -384,7 +381,7 @@ impl Definitions {
384381
hash: DefPathHash,
385382
err: &mut dyn FnMut() -> !,
386383
) -> LocalDefId {
387-
debug_assert!(hash.stable_crate_id() == self.stable_crate_id);
384+
debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id);
388385
self.table
389386
.def_path_hash_to_index
390387
.get(&hash)

0 commit comments

Comments
 (0)