From c4bcac628cd44e8585a7b45583ae702624d13d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Sun, 19 Mar 2023 17:39:27 +0100 Subject: [PATCH] Add some assertions --- compiler/rustc_query_system/src/dep_graph/graph.rs | 1 + compiler/rustc_query_system/src/query/plumbing.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 8a9a1238606..6aa816d09fe 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -970,6 +970,7 @@ impl DepGraph { } pub(crate) fn next_virtual_depnode_index(&self) -> DepNodeIndex { + debug_assert!(self.data.is_none()); let index = self.virtual_dep_node_index.fetch_add(1, Relaxed); DepNodeIndex::from_u32(index) } diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index a6c464d0972..ba2f859ff0f 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -429,6 +429,8 @@ where Q: QueryConfig, Qcx: QueryContext, { + debug_assert!(!qcx.dep_context().dep_graph().is_fully_enabled()); + // Fingerprint the key, just to assert that it doesn't // have anything we don't consider hashable if cfg!(debug_assertions) {