about summary refs log tree commit diff
path: root/compiler/rustc_query_system/src/query
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-05-08 14:42:12 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-29 18:39:03 +0000
commitca42dd67167575daa95a9f3c0d084d44f6c2ad2a (patch)
tree1ff08267c7aedbb0451cc15d3f69ab276a535682 /compiler/rustc_query_system/src/query
parent7c45772bc996cac15c090cdeb13ac14f713486d0 (diff)
downloadrust-ca42dd67167575daa95a9f3c0d084d44f6c2ad2a.tar.gz
rust-ca42dd67167575daa95a9f3c0d084d44f6c2ad2a.zip
Sanity check fingerprints in the dep-graph.
Diffstat (limited to 'compiler/rustc_query_system/src/query')
-rw-r--r--compiler/rustc_query_system/src/query/caches.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_query_system/src/query/caches.rs b/compiler/rustc_query_system/src/query/caches.rs
index cdd43572422..4c4680b5d8e 100644
--- a/compiler/rustc_query_system/src/query/caches.rs
+++ b/compiler/rustc_query_system/src/query/caches.rs
@@ -117,6 +117,8 @@ where
         let mut lock = self.cache.get_shard_by_value(&key).lock();
         #[cfg(not(parallel_compiler))]
         let mut lock = self.cache.lock();
+        // We may be overwriting another value.  This is all right, since the dep-graph
+        // will check that the fingerprint matches.
         lock.insert(key, (value.clone(), index));
         value
     }
@@ -202,6 +204,8 @@ where
         let mut lock = self.cache.get_shard_by_value(&key).lock();
         #[cfg(not(parallel_compiler))]
         let mut lock = self.cache.lock();
+        // We may be overwriting another value.  This is all right, since the dep-graph
+        // will check that the fingerprint matches.
         lock.insert(key, value);
         &value.0
     }