about summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-04-22 03:55:57 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-04-22 16:57:28 +0200
commit9a6e8b3807e91836f1936df507a231e38cf76d16 (patch)
tree62165100ba9c01d482502e0e780e3eedf02cf69a /compiler/rustc_query_system
parent36fa327623b6013b0a3da6e39ee1e85ac5275cd9 (diff)
downloadrust-9a6e8b3807e91836f1936df507a231e38cf76d16.tar.gz
rust-9a6e8b3807e91836f1936df507a231e38cf76d16.zip
Make sure there's no duplicate indices in the dep graph
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/dep_graph/serialized.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/serialized.rs b/compiler/rustc_query_system/src/dep_graph/serialized.rs
index 0d4913e798d..d2bcde14383 100644
--- a/compiler/rustc_query_system/src/dep_graph/serialized.rs
+++ b/compiler/rustc_query_system/src/dep_graph/serialized.rs
@@ -225,7 +225,11 @@ impl SerializedDepGraph {
 
             let index = node_header.index();
 
-            nodes[index] = node_header.node();
+            let node = &mut nodes[index];
+            // Make sure there's no duplicate indices in the dep graph.
+            assert!(node_header.node().kind != D::DEP_KIND_NULL && node.kind == D::DEP_KIND_NULL);
+            *node = node_header.node();
+
             fingerprints[index] = node_header.fingerprint();
 
             // If the length of this node's edge list is small, the length is stored in the header.