Skip to content

Commit 929b4a9

Browse files
author
Markus Westerlind
committed
a
1 parent cca4b12 commit 929b4a9

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

compiler/rustc_data_structures/src/obligation_forest/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ impl<O: ForestObligation> ObligationForest<O> {
733733
// `for index in 0..self.nodes.len() { ... }` because the range would
734734
// be computed with the initial length, and we would miss the appended
735735
// nodes. Therefore we use a `while` loop.
736+
let mut completed = vec![];
736737
loop {
737738
let mut i = 0;
738739
let mut made_progress_this_iteration = false;
@@ -826,10 +827,15 @@ impl<O: ForestObligation> ObligationForest<O> {
826827

827828
self.mark_successes();
828829
self.process_cycles(processor);
829-
self.compress(do_completed);
830+
if let Some(mut c) = self.compress(do_completed) {
831+
completed.append(&mut c);
832+
}
830833
}
831834

832-
Some(Outcome { completed: None, errors })
835+
Some(Outcome {
836+
completed: if do_completed == DoCompleted::Yes { Some(completed) } else { None },
837+
errors,
838+
})
833839
}
834840

835841
/// Checks which nodes have been unblocked since the last time this was called. All nodes that

compiler/rustc_data_structures/src/obligation_forest/tests.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ where
8080
type Obligation = O;
8181
type Error = E;
8282

83+
fn checked_process_obligation(
84+
&mut self,
85+
obligation: &mut Self::Obligation,
86+
) -> ProcessResult<Self::Obligation, Self::Error> {
87+
(self.process_obligation)(obligation)
88+
}
89+
8390
fn process_obligation(
8491
&mut self,
8592
obligation: &mut Self::Obligation,

0 commit comments

Comments
 (0)