Skip to content

Commit 00c421e

Browse files
committed
Workaround hash cache coherency issue in WithCachedTypeInfo
1 parent 9f5c775 commit 00c421e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/rustc_type_ir/src/ty_info.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ use std::ops::Deref;
55
#[cfg(feature = "nightly")]
66
use rustc_data_structures::fingerprint::Fingerprint;
77
#[cfg(feature = "nightly")]
8-
use rustc_data_structures::stable_hasher::{ExtendedHasher, GenericStableHasher, HashStable};
8+
use rustc_data_structures::stable_hasher::{
9+
ExtendedHasher, GenericStableHasher, HashStable, StableHasher,
10+
};
911

1012
use crate::{DebruijnIndex, TypeFlags};
1113

@@ -106,7 +108,10 @@ impl<T: HashStable<CTX>, CTX> HashStable<CTX> for WithCachedTypeInfo<T> {
106108
// We need to build the hash as if we cached it and then hash that hash, as
107109
// otherwise the hashes will differ between cached and non-cached mode.
108110
let stable_hash: Fingerprint = {
109-
let mut hasher = GenericStableHasher::<H>::new();
111+
// FIXME: Using the generic stable hasher creates a cache coherency issue
112+
// so for now always use the `StableHasher` instead.
113+
// let mut hasher = GenericStableHasher::<H>::new();
114+
let mut hasher = StableHasher::new();
110115
self.internee.hash_stable(hcx, &mut hasher);
111116
hasher.finish()
112117
};

0 commit comments

Comments
 (0)