DepGraphQuery: correctly skip adding edges with not-yet-added nodes

This commit is contained in:
Vadim Petrochenkov 2026-02-13 23:39:37 +03:00
parent 5d04477ea8
commit b0366ce935

View file

@ -28,10 +28,9 @@ impl DepGraphQuery {
self.indices.insert(node, source);
for &target in edges.iter() {
let target = self.dep_index_to_index[target];
// We may miss the edges that are pushed while the `DepGraphQuery` is being accessed.
// Skip them to issues.
if let Some(target) = target {
if let Some(&Some(target)) = self.dep_index_to_index.get(target) {
self.graph.add_edge(source, target, ());
}
}