From ba46b6837367204e0ae4ba020a788df06dc2ebd8 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Fri, 11 Nov 2022 20:03:33 +0000 Subject: [PATCH] Skip stable hashing without incremental. --- compiler/rustc_middle/src/ty/context.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 0ac712565b5..8f96f5a9eb3 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -192,7 +192,9 @@ impl<'tcx> CtxtInterners<'tcx> { // It's impossible to hash inference variables (and will ICE), so we don't need to try to cache them. // Without incremental, we rarely stable-hash types, so let's not do it proactively. - let stable_hash = if flags.flags.intersects(TypeFlags::NEEDS_INFER) { + let stable_hash = if flags.flags.intersects(TypeFlags::NEEDS_INFER) + || sess.opts.incremental.is_none() + { Fingerprint::ZERO } else { let mut hasher = StableHasher::new();