Skip to content

Commit c4bcac6

Browse files
committed
Add some assertions
1 parent 486a387 commit c4bcac6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Diff for: compiler/rustc_query_system/src/dep_graph/graph.rs

+1
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ impl<K: DepKind> DepGraph<K> {
970970
}
971971

972972
pub(crate) fn next_virtual_depnode_index(&self) -> DepNodeIndex {
973+
debug_assert!(self.data.is_none());
973974
let index = self.virtual_dep_node_index.fetch_add(1, Relaxed);
974975
DepNodeIndex::from_u32(index)
975976
}

Diff for: compiler/rustc_query_system/src/query/plumbing.rs

+2
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ where
429429
Q: QueryConfig<Qcx>,
430430
Qcx: QueryContext,
431431
{
432+
debug_assert!(!qcx.dep_context().dep_graph().is_fully_enabled());
433+
432434
// Fingerprint the key, just to assert that it doesn't
433435
// have anything we don't consider hashable
434436
if cfg!(debug_assertions) {

0 commit comments

Comments
 (0)