Skip stable hashing without incremental.

This commit is contained in:
Camille GILLOT 2022-11-11 20:03:33 +00:00
parent 9d86e6abaf
commit ba46b68373

View File

@ -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();