Skip to content

Commit 5f7b989

Browse files
committed
Add comment on stable_hash_impl for OwnerNodes
1 parent 009c1d0 commit 5f7b989

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_hir/src/stable_hash_impls.rs

+3
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for OwnerNodes<'
208208
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
209209
// We ignore the `nodes` and `bodies` fields since these refer to information included in
210210
// `hash` which is hashed in the collector and used for the crate hash.
211+
// `local_id_to_def_id` is also ignored because is dependent on the body, then just hashing
212+
// the body satisfies the condition of two nodes being different have different
213+
// `hash_stable` results.
211214
let OwnerNodes {
212215
hash_including_bodies,
213216
hash_without_bodies: _,

0 commit comments

Comments
 (0)