diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-12-24 01:06:58 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-12-24 17:22:48 +0000 |
| commit | 75ad81ce934123d71c9662fbbd5ca67ef507cbfb (patch) | |
| tree | 8127eae1ae01206bebb7eb140134969642bd5d2c | |
| parent | 027fa9e23b6cc66a1ea9a88479dadf4056a10430 (diff) | |
| download | rust-75ad81ce934123d71c9662fbbd5ca67ef507cbfb.tar.gz rust-75ad81ce934123d71c9662fbbd5ca67ef507cbfb.zip | |
Do not store stable_crate_id again in Definitions.
| -rw-r--r-- | compiler/rustc_hir/src/definitions.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index 46c39110992..d6bbf183f3b 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -103,9 +103,6 @@ impl DefPathTable { pub struct Definitions { table: DefPathTable, next_disambiguator: UnordMap<(LocalDefId, DefPathData), u32>, - - /// The [StableCrateId] of the local crate. - stable_crate_id: StableCrateId, } /// A unique identifier that we can use to lookup a definition @@ -340,7 +337,7 @@ impl Definitions { let root = LocalDefId { local_def_index: table.allocate(key, def_path_hash) }; assert_eq!(root.local_def_index, CRATE_DEF_INDEX); - Definitions { table, next_disambiguator: Default::default(), stable_crate_id } + Definitions { table, next_disambiguator: Default::default() } } /// Adds a definition with a parent definition. @@ -382,7 +379,7 @@ impl Definitions { hash: DefPathHash, err: &mut dyn FnMut() -> !, ) -> LocalDefId { - debug_assert!(hash.stable_crate_id() == self.stable_crate_id); + debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id); self.table .def_path_hash_to_index .get(&hash) |
