diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-01-30 17:47:51 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:32:10 +0100 |
| commit | cebbba081e4609099df3921de8a1422b7ea52599 (patch) | |
| tree | 96784e4ada9c7d62e8890ce8bac2d4f840eba6c4 /compiler/rustc_hir/src/stable_hash_impls.rs | |
| parent | bd3cd5dbed5f56fb44a14a20dd2113e3049d2565 (diff) | |
| download | rust-cebbba081e4609099df3921de8a1422b7ea52599.tar.gz rust-cebbba081e4609099df3921de8a1422b7ea52599.zip | |
Only store a LocalDefId in hir::Item.
Items are guaranteed to be HIR owner.
Diffstat (limited to 'compiler/rustc_hir/src/stable_hash_impls.rs')
| -rw-r--r-- | compiler/rustc_hir/src/stable_hash_impls.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_hir/src/stable_hash_impls.rs b/compiler/rustc_hir/src/stable_hash_impls.rs index d8831ec553d..b0d332e0028 100644 --- a/compiler/rustc_hir/src/stable_hash_impls.rs +++ b/compiler/rustc_hir/src/stable_hash_impls.rs @@ -35,11 +35,11 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for HirId { } impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ItemId { - type KeyType = (DefPathHash, ItemLocalId); + type KeyType = DefPathHash; #[inline] - fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) { - self.id.to_stable_hash_key(hcx) + fn to_stable_hash_key(&self, hcx: &HirCtx) -> DefPathHash { + hcx.local_def_path_hash(self.def_id) } } @@ -91,7 +91,7 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for BodyId { impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ItemId { fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) { - hcx.hash_reference_to_item(self.id, hasher) + hcx.hash_reference_to_item(self.hir_id(), hasher) } } @@ -178,7 +178,7 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItem<'_> { impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Item<'_> { fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) { - let Item { ident, ref attrs, hir_id: _, ref kind, ref vis, span } = *self; + let Item { ident, ref attrs, def_id: _, ref kind, ref vis, span } = *self; hcx.hash_hir_item_like(|hcx| { ident.name.hash_stable(hcx, hasher); |
