Skip to content

Commit fa5c5e0

Browse files
committed
Make sure there's no duplicate indices in the dep graph
1 parent 350bbd3 commit fa5c5e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_query_system/src/dep_graph/serialized.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ impl SerializedDepGraph {
225225

226226
let index = node_header.index();
227227

228-
nodes[index] = node_header.node();
228+
let node = &mut nodes[index];
229+
// Make sure there's no duplicate indices in the dep graph.
230+
assert!(node_header.node().kind != D::DEP_KIND_NULL && node.kind == D::DEP_KIND_NULL);
231+
*node = node_header.node();
232+
229233
fingerprints[index] = node_header.fingerprint();
230234

231235
// If the length of this node's edge list is small, the length is stored in the header.

0 commit comments

Comments
 (0)