From ca42dd67167575daa95a9f3c0d084d44f6c2ad2a Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 8 May 2022 14:42:12 +0200 Subject: Sanity check fingerprints in the dep-graph. --- compiler/rustc_query_system/src/query/caches.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_query_system/src/query') 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 } -- cgit 1.4.1-3-g733a5