diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-11 12:18:49 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-11 13:02:37 +0000 |
| commit | 9d86e6abaf972bf3a31a8e5e3d948b7d5bf0d289 (patch) | |
| tree | 7138db5ed5d68b29c892aac0c0172c06d9cd3401 /compiler/rustc_data_structures/src | |
| parent | d47424b8339e3c6f2e313ccc7bb08c6857d86e44 (diff) | |
| download | rust-9d86e6abaf972bf3a31a8e5e3d948b7d5bf0d289.tar.gz rust-9d86e6abaf972bf3a31a8e5e3d948b7d5bf0d289.zip | |
Use the interned stable hash as plain hash.
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/intern.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/intern.rs b/compiler/rustc_data_structures/src/intern.rs index 8c94ce29b42..11cbff8ea6a 100644 --- a/compiler/rustc_data_structures/src/intern.rs +++ b/compiler/rustc_data_structures/src/intern.rs @@ -156,7 +156,11 @@ impl<T> Deref for WithStableHash<T> { impl<T: Hash> Hash for WithStableHash<T> { #[inline] fn hash<H: Hasher>(&self, s: &mut H) { - self.internee.hash(s) + if self.stable_hash != Fingerprint::ZERO { + self.stable_hash.hash(s) + } else { + self.internee.hash(s) + } } } |
