about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-01-28 18:06:53 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-01-28 18:06:53 -0300
commit5f7b9892754b19c3146f24dc3c0cdbda98f6efac (patch)
tree801ac93977c6978cced3f01b0905cffc36b6e589
parent009c1d02484dcc18e1596a33b3d8989a90361c89 (diff)
downloadrust-5f7b9892754b19c3146f24dc3c0cdbda98f6efac.tar.gz
rust-5f7b9892754b19c3146f24dc3c0cdbda98f6efac.zip
Add comment on stable_hash_impl for OwnerNodes
-rw-r--r--compiler/rustc_hir/src/stable_hash_impls.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/stable_hash_impls.rs b/compiler/rustc_hir/src/stable_hash_impls.rs
index b15054ae6d6..42a5bb7db9e 100644
--- a/compiler/rustc_hir/src/stable_hash_impls.rs
+++ b/compiler/rustc_hir/src/stable_hash_impls.rs
@@ -208,6 +208,9 @@ impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for OwnerNodes<'
     fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
         // We ignore the `nodes` and `bodies` fields since these refer to information included in
         // `hash` which is hashed in the collector and used for the crate hash.
+        // `local_id_to_def_id` is also ignored because is dependent on the body, then just hashing
+        // the body satisfies the condition of two nodes being different have different
+        // `hash_stable` results.
         let OwnerNodes {
             hash_including_bodies,
             hash_without_bodies: _,