Skip to content

Commit 59d74d7

Browse files
committed
DepGraphQuery: correctly skip adding edges with not-yet-added nodes
1 parent d7daac0 commit 59d74d7

File tree

1 file changed

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

1 file changed

+1
-2
lines changed

compiler/rustc_query_system/src/dep_graph/query.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ impl DepGraphQuery {
2828
self.indices.insert(node, source);
2929

3030
for &target in edges.iter() {
31-
let target = self.dep_index_to_index[target];
3231
// We may miss the edges that are pushed while the `DepGraphQuery` is being accessed.
3332
// Skip them to issues.
34-
if let Some(target) = target {
33+
if let Some(&Some(target)) = self.dep_index_to_index.get(target) {
3534
self.graph.add_edge(source, target, ());
3635
}
3736
}

0 commit comments

Comments
 (0)