diff --git a/compiler/rustc_data_structures/src/intern.rs b/compiler/rustc_data_structures/src/intern.rs index 1b187cd306e9..bd62f30372ef 100644 --- a/compiler/rustc_data_structures/src/intern.rs +++ b/compiler/rustc_data_structures/src/intern.rs @@ -160,9 +160,7 @@ impl Hash for InTy { impl, CTX: InternedHashingContext> HashStable for InTy { fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) { - let stable_hash = self.stable_hash; - - if stable_hash == Fingerprint::ZERO { + if self.stable_hash == Fingerprint::ZERO || cfg!(debug_assertions) { // No cached hash available. This can only mean that incremental is disabled. // We don't cache stable hashes in non-incremental mode, because they are used // so rarely that the performance actually suffers. @@ -174,9 +172,15 @@ impl, CTX: InternedHashingContext> HashStable for InTy