mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
DepGraphQuery: correctly skip adding edges with not-yet-added nodes
This commit is contained in:
@@ -28,10 +28,9 @@ pub fn push(&mut self, index: DepNodeIndex, node: DepNode, edges: &[DepNodeIndex
|
||||
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, ());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user