about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-11-11 12:18:49 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-11 13:02:37 +0000
commit9d86e6abaf972bf3a31a8e5e3d948b7d5bf0d289 (patch)
tree7138db5ed5d68b29c892aac0c0172c06d9cd3401 /compiler/rustc_data_structures/src
parentd47424b8339e3c6f2e313ccc7bb08c6857d86e44 (diff)
downloadrust-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.rs6
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)
+        }
     }
 }