diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-01-30 20:46:50 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:32:28 +0100 |
| commit | a871a0f11196ed028edeedc4843338f702880672 (patch) | |
| tree | c8420d83e77f3b66d3b47b6ddfc1aac50626f63b /compiler/rustc_hir/src/stable_hash_impls.rs | |
| parent | cebbba081e4609099df3921de8a1422b7ea52599 (diff) | |
| download | rust-a871a0f11196ed028edeedc4843338f702880672.tar.gz rust-a871a0f11196ed028edeedc4843338f702880672.zip | |
Only store a LocalDefId in hir::TraitItem.
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 b0d332e0028..e7e676fe147 100644 --- a/compiler/rustc_hir/src/stable_hash_impls.rs +++ b/compiler/rustc_hir/src/stable_hash_impls.rs @@ -44,11 +44,11 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ItemId { } impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for TraitItemId { - type KeyType = (DefPathHash, ItemLocalId); + type KeyType = DefPathHash; #[inline] - fn to_stable_hash_key(&self, hcx: &HirCtx) -> (DefPathHash, ItemLocalId) { - self.hir_id.to_stable_hash_key(hcx) + fn to_stable_hash_key(&self, hcx: &HirCtx) -> DefPathHash { + hcx.local_def_path_hash(self.def_id) } } @@ -109,7 +109,7 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItemId { impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItemId { fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) { - hcx.hash_reference_to_item(self.hir_id, hasher) + hcx.hash_reference_to_item(self.hir_id(), hasher) } } @@ -139,7 +139,7 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for VisibilityKind<'_> impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItem<'_> { fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) { - let TraitItem { hir_id: _, ident, ref attrs, ref generics, ref kind, span } = *self; + let TraitItem { def_id: _, ident, ref attrs, ref generics, ref kind, span } = *self; hcx.hash_hir_item_like(|hcx| { ident.name.hash_stable(hcx, hasher); |
