Skip to content

Commit e8b72f4

Browse files
committed
move item reference comment
1 parent 28b0ed0 commit e8b72f4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc/ich/impls_hir.rs

-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
4040
}
4141
}
4242

43-
// The following implementations of HashStable for `ItemId`, `TraitItemId`, and
44-
// `ImplItemId` deserve special attention. Normally we do not hash `NodeId`s within
45-
// the HIR, since they just signify a HIR nodes own path. But `ItemId` et al
46-
// are used when another item in the HIR is *referenced* and we certainly
47-
// want to pick up on a reference changing its target, so we hash the NodeIds
48-
// in "DefPath Mode".
49-
5043
fn hash_reference_to_item(&mut self, id: hir::HirId, hasher: &mut StableHasher) {
5144
let hcx = self;
5245

src/librustc_hir/stable_hash_impls.rs

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for BodyId {
3636
}
3737
}
3838

39+
// The following implementations of HashStable for `ItemId`, `TraitItemId`, and
40+
// `ImplItemId` deserve special attention. Normally we do not hash `NodeId`s within
41+
// the HIR, since they just signify a HIR nodes own path. But `ItemId` et al
42+
// are used when another item in the HIR is *referenced* and we certainly
43+
// want to pick up on a reference changing its target, so we hash the NodeIds
44+
// in "DefPath Mode".
45+
3946
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ItemId {
4047
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
4148
hcx.hash_reference_to_item(self.id, hasher)

0 commit comments

Comments
 (0)