@@ -3,7 +3,7 @@ use rustc_span::def_id::DefPathHash;
33
44use crate :: HashIgnoredAttrId ;
55use crate :: hir:: {
6- AttributeMap , BodyId , ForeignItemId , ImplItemId , ItemId , OwnerNodes , TraitItemId ,
6+ AttributeMap , BodyId , ForeignItemId , ImplItemId , ItemId , OwnerInfo , OwnerNodes , TraitItemId ,
77} ;
88use crate :: hir_id:: ItemLocalId ;
99use crate :: lints:: DelayedLints ;
@@ -69,25 +69,25 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ForeignItemId
6969// in "DefPath Mode".
7070
7171impl < ' tcx , HirCtx : crate :: HashStableContext > HashStable < HirCtx > for OwnerNodes < ' tcx > {
72+ #[ inline]
7273 fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
73- // We ignore the `nodes` and `bodies` fields since these refer to information included in
74- // `hash` which is hashed in the collector and used for the crate hash.
75- // `local_id_to_def_id` is also ignored because is dependent on the body, then just hashing
76- // the body satisfies the condition of two nodes being different have different
77- // `hash_stable` results.
78- let OwnerNodes { opt_hash_including_bodies, nodes : _, bodies : _ } = * self ;
79- opt_hash_including_bodies. unwrap ( ) . hash_stable ( hcx, hasher) ;
74+ // We ignore the other fields since these refer to information included in
75+ // `opt_hash` which is hashed in the collector and used for the crate hash.
76+ let OwnerNodes { opt_hash, .. } = * self ;
77+ opt_hash. unwrap ( ) . hash_stable ( hcx, hasher) ;
8078 }
8179}
8280
8381impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for DelayedLints {
82+ #[ inline]
8483 fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
8584 let DelayedLints { opt_hash, .. } = * self ;
8685 opt_hash. unwrap ( ) . hash_stable ( hcx, hasher) ;
8786 }
8887}
8988
9089impl < ' tcx , HirCtx : crate :: HashStableContext > HashStable < HirCtx > for AttributeMap < ' tcx > {
90+ #[ inline]
9191 fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
9292 // We ignore the `map` since it refers to information included in `opt_hash` which is
9393 // hashed in the collector and used for the crate hash.
@@ -96,6 +96,16 @@ impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for AttributeMap
9696 }
9797}
9898
99+ impl < ' tcx , HirCtx : crate :: HashStableContext > HashStable < HirCtx > for OwnerInfo < ' tcx > {
100+ #[ inline]
101+ fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
102+ // We ignore the rest since it refers to information included in `opt_hash` which is
103+ // hashed in the collector and used for the crate hash.
104+ let OwnerInfo { opt_hash, .. } = * self ;
105+ opt_hash. unwrap ( ) . hash_stable ( hcx, hasher) ;
106+ }
107+ }
108+
99109impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for HashIgnoredAttrId {
100110 fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
101111 hcx. hash_attr_id ( self , hasher)
0 commit comments