File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
rustc_data_structures/src Expand file tree Collapse file tree 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> {
156156impl < T : Hash > Hash for WithStableHash < T > {
157157 #[ inline]
158158 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+ }
160164 }
161165}
162166
Original file line number Diff line number Diff line change @@ -192,9 +192,7 @@ impl<'tcx> CtxtInterners<'tcx> {
192192
193193 // It's impossible to hash inference variables (and will ICE), so we don't need to try to cache them.
194194 // 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 ) {
198196 Fingerprint :: ZERO
199197 } else {
200198 let mut hasher = StableHasher :: new ( ) ;
You can’t perform that action at this time.
0 commit comments