Skip to content

Commit 02bace8

Browse files
committed
Add a sanity check in case of any duplicate nodes
1 parent f520900 commit 02bace8

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_query_system/src/dep_graph

1 file changed

+3
-1
lines changed

compiler/rustc_query_system/src/dep_graph/graph.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,9 @@ impl DepNodeColorMap {
13841384

13851385
#[inline]
13861386
pub(super) fn insert_red(&self, index: SerializedDepNodeIndex) {
1387-
self.values[index].store(COMPRESSED_RED, Ordering::Release)
1387+
let value = self.values[index].swap(COMPRESSED_RED, Ordering::Release);
1388+
// Sanity check for duplicate nodes
1389+
assert_eq!(value, COMPRESSED_UNKNOWN, "trying to encode a dep node twice");
13881390
}
13891391
}
13901392

0 commit comments

Comments
 (0)