Skip to content

Commit 795c810

Browse files
author
Markus Westerlind
committed
Restore clearing of stalled_on before process_obligation
1 parent 34f3303 commit 795c810

File tree

1 file changed

+23
-0
lines changed
  • compiler/rustc_data_structures/src/obligation_forest

1 file changed

+23
-0
lines changed

compiler/rustc_data_structures/src/obligation_forest/mod.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,29 @@ impl<O: ForestObligation> ObligationForest<O> {
620620
continue;
621621
}
622622

623+
// One of the variables we stalled on unblocked us. If the node were blocked on other
624+
// variables as well then remove those stalls. If the node is still stalled on one of
625+
// those variables after `process_obligation` it will simply be added back to
626+
// `self.stalled_on`
627+
let stalled_on = node.obligation.stalled_on();
628+
if stalled_on.len() > 1 {
629+
for var in stalled_on {
630+
match self.stalled_on.entry(var.clone()) {
631+
Entry::Vacant(_) => (),
632+
Entry::Occupied(mut entry) => {
633+
let nodes = entry.get_mut();
634+
if let Some(i) = nodes.iter().position(|x| *x == index) {
635+
nodes.swap_remove(i);
636+
}
637+
if nodes.is_empty() {
638+
processor.unwatch_variable(var.clone());
639+
entry.remove();
640+
}
641+
}
642+
}
643+
}
644+
}
645+
623646
// `processor.process_obligation` can modify the predicate within
624647
// `node.obligation`, and that predicate is the key used for
625648
// `self.active_cache`. This means that `self.active_cache` can get

0 commit comments

Comments
 (0)