]> git.lizzy.rs Git - rust.git/commitdiff
move item reference comment
authorljedrz <ljedrz@gmail.com>
Wed, 5 Feb 2020 10:29:07 +0000 (11:29 +0100)
committerljedrz <ljedrz@gmail.com>
Wed, 5 Feb 2020 10:29:07 +0000 (11:29 +0100)
src/librustc/ich/impls_hir.rs
src/librustc_hir/stable_hash_impls.rs

index 1e5a722c1011658fdb12afe749f0a4eb6298df86..01558615497731073ab20985800fc9bdae7ad986 100644 (file)
@@ -40,13 +40,6 @@ fn hash_body_id(&mut self, id: hir::BodyId, hasher: &mut StableHasher) {
         }
     }
 
-    // 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;
 
index 94e02d9cd94fe091e8a40ad5d58167628c2cef17..294074cd3e5a47a55dfe87f5a26bf31275fec7e9 100644 (file)
@@ -36,6 +36,13 @@ fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
     }
 }
 
+// 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<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)