about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-11-11 20:03:33 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-11 20:03:33 +0000
commitba46b6837367204e0ae4ba020a788df06dc2ebd8 (patch)
tree0b7fe37941781bb400e633852316f04bd4c9195f
parent9d86e6abaf972bf3a31a8e5e3d948b7d5bf0d289 (diff)
downloadrust-ba46b6837367204e0ae4ba020a788df06dc2ebd8.tar.gz
rust-ba46b6837367204e0ae4ba020a788df06dc2ebd8.zip
Skip stable hashing without incremental.
-rw-r--r--compiler/rustc_middle/src/ty/context.rs4
1 files changed, 3 insertions, 1 deletions
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();