@@ -3,7 +3,7 @@ use rustc_span::def_id::DefPathHash;
3
3
4
4
use crate :: HashIgnoredAttrId ;
5
5
use crate :: hir:: {
6
- AttributeMap , BodyId , ForeignItemId , ImplItemId , ItemId , OwnerNodes , TraitItemId ,
6
+ AttributeMap , BodyId , ForeignItemId , ImplItemId , ItemId , OwnerInfo , OwnerNodes , TraitItemId ,
7
7
} ;
8
8
use crate :: hir_id:: { HirId , ItemLocalId } ;
9
9
use crate :: lints:: DelayedLints ;
@@ -92,25 +92,25 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ForeignItemId
92
92
// in "DefPath Mode".
93
93
94
94
impl < ' tcx , HirCtx : crate :: HashStableContext > HashStable < HirCtx > for OwnerNodes < ' tcx > {
95
+ #[ inline]
95
96
fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
96
- // We ignore the `nodes` and `bodies` fields since these refer to information included in
97
- // `hash` which is hashed in the collector and used for the crate hash.
98
- // `local_id_to_def_id` is also ignored because is dependent on the body, then just hashing
99
- // the body satisfies the condition of two nodes being different have different
100
- // `hash_stable` results.
101
- let OwnerNodes { opt_hash_including_bodies, nodes : _, bodies : _ } = * self ;
102
- opt_hash_including_bodies. unwrap ( ) . hash_stable ( hcx, hasher) ;
97
+ // We ignore the other fields since these refer to information included in
98
+ // `opt_hash` which is hashed in the collector and used for the crate hash.
99
+ let OwnerNodes { opt_hash, .. } = * self ;
100
+ opt_hash. unwrap ( ) . hash_stable ( hcx, hasher) ;
103
101
}
104
102
}
105
103
106
104
impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for DelayedLints {
105
+ #[ inline]
107
106
fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
108
107
let DelayedLints { opt_hash, .. } = * self ;
109
108
opt_hash. unwrap ( ) . hash_stable ( hcx, hasher) ;
110
109
}
111
110
}
112
111
113
112
impl < ' tcx , HirCtx : crate :: HashStableContext > HashStable < HirCtx > for AttributeMap < ' tcx > {
113
+ #[ inline]
114
114
fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
115
115
// We ignore the `map` since it refers to information included in `opt_hash` which is
116
116
// hashed in the collector and used for the crate hash.
@@ -119,6 +119,16 @@ impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for AttributeMap
119
119
}
120
120
}
121
121
122
+ impl < ' tcx , HirCtx : crate :: HashStableContext > HashStable < HirCtx > for OwnerInfo < ' tcx > {
123
+ #[ inline]
124
+ fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
125
+ // We ignore the rest since it refers to information included in `opt_hash` which is
126
+ // hashed in the collector and used for the crate hash.
127
+ let OwnerInfo { opt_hash, .. } = * self ;
128
+ opt_hash. unwrap ( ) . hash_stable ( hcx, hasher) ;
129
+ }
130
+ }
131
+
122
132
impl < HirCtx : crate :: HashStableContext > HashStable < HirCtx > for HashIgnoredAttrId {
123
133
fn hash_stable ( & self , hcx : & mut HirCtx , hasher : & mut StableHasher ) {
124
134
hcx. hash_attr_id ( self , hasher)
0 commit comments