File tree 2 files changed +6
-4
lines changed
rustc_data_structures/src
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,11 @@ impl<T> Deref for WithStableHash<T> {
156
156
impl < T : Hash > Hash for WithStableHash < T > {
157
157
#[ inline]
158
158
fn hash < H : Hasher > ( & self , s : & mut H ) {
159
- self . internee . hash ( s)
159
+ if self . stable_hash != Fingerprint :: ZERO {
160
+ self . stable_hash . hash ( s)
161
+ } else {
162
+ self . internee . hash ( s)
163
+ }
160
164
}
161
165
}
162
166
Original file line number Diff line number Diff line change @@ -192,9 +192,7 @@ impl<'tcx> CtxtInterners<'tcx> {
192
192
193
193
// It's impossible to hash inference variables (and will ICE), so we don't need to try to cache them.
194
194
// Without incremental, we rarely stable-hash types, so let's not do it proactively.
195
- let stable_hash = if flags. flags . intersects ( TypeFlags :: NEEDS_INFER )
196
- || sess. opts . incremental . is_none ( )
197
- {
195
+ let stable_hash = if flags. flags . intersects ( TypeFlags :: NEEDS_INFER ) {
198
196
Fingerprint :: ZERO
199
197
} else {
200
198
let mut hasher = StableHasher :: new ( ) ;
You can’t perform that action at this time.
0 commit comments