From e8b72f44b0064d0e591f078f6b7f2cf3aa28f540 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Wed, 5 Feb 2020 11:29:07 +0100 Subject: [PATCH] move item reference comment --- src/librustc/ich/impls_hir.rs | 7 ------- src/librustc_hir/stable_hash_impls.rs | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index 1e5a722c1011..015586154977 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -40,13 +40,6 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> { } } - // The following implementations of HashStable for `ItemId`, `TraitItemId`, and - // `ImplItemId` deserve special attention. Normally we do not hash `NodeId`s within - // the HIR, since they just signify a HIR nodes own path. But `ItemId` et al - // are used when another item in the HIR is *referenced* and we certainly - // want to pick up on a reference changing its target, so we hash the NodeIds - // in "DefPath Mode". - fn hash_reference_to_item(&mut self, id: hir::HirId, hasher: &mut StableHasher) { let hcx = self; diff --git a/src/librustc_hir/stable_hash_impls.rs b/src/librustc_hir/stable_hash_impls.rs index 94e02d9cd94f..294074cd3e5a 100644 --- a/src/librustc_hir/stable_hash_impls.rs +++ b/src/librustc_hir/stable_hash_impls.rs @@ -36,6 +36,13 @@ impl HashStable for BodyId { } } +// The following implementations of HashStable for `ItemId`, `TraitItemId`, and +// `ImplItemId` deserve special attention. Normally we do not hash `NodeId`s within +// the HIR, since they just signify a HIR nodes own path. But `ItemId` et al +// are used when another item in the HIR is *referenced* and we certainly +// want to pick up on a reference changing its target, so we hash the NodeIds +// in "DefPath Mode". + impl HashStable for ItemId { fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) { hcx.hash_reference_to_item(self.id, hasher)