Skip to content

Commit 421b61d

Browse files
committed
Check for duplicate dep nodes when creating the index
1 parent eaf5e21 commit 421b61d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_query_system/src/dep_graph/serialized.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,14 @@ impl SerializedDepGraph {
252252
.collect();
253253

254254
for (idx, node) in nodes.iter_enumerated() {
255-
index[node.kind.as_usize()].insert(node.hash, idx);
255+
if index[node.kind.as_usize()].insert(node.hash, idx).is_some() {
256+
panic!(
257+
"Error: A dep graph node does not have an unique index. \
258+
Running a clean build on a nightly compiler with `-Z incremental-verify-ich` \
259+
can help narrow down the issue for reporting. A clean build may also work around the issue.\n
260+
DepNode: {node:?}"
261+
)
262+
}
256263
}
257264

258265
Arc::new(SerializedDepGraph {

0 commit comments

Comments
 (0)