1
Fork 0

Handle stalling within ObligationForest.

It is simpler if `ObligationForest` does this itself, rather than the
caller having to manage it.
This commit is contained in:
Nicholas Nethercote 2022-06-01 17:17:05 +10:00
parent cdb446fec3
commit 281229a6d3
3 changed files with 68 additions and 101 deletions

View file

@ -133,27 +133,16 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> {
let mut errors = Vec::new();
loop {
debug!("select: starting another iteration");
// Process pending obligations.
let outcome: Outcome<_, _> = self.predicates.process_obligations(&mut FulfillProcessor {
selcx,
register_region_obligations: self.register_region_obligations,
});
// Process pending obligations.
let outcome: Outcome<_, _> =
self.predicates.process_obligations(&mut FulfillProcessor {
selcx,
register_region_obligations: self.register_region_obligations,
});
debug!("select: outcome={:#?}", outcome);
// FIXME: if we kept the original cache key, we could mark projection
// obligations as complete for the projection cache here.
// FIXME: if we kept the original cache key, we could mark projection
// obligations as complete for the projection cache here.
errors.extend(outcome.errors.into_iter().map(to_fulfillment_error));
// If nothing new was added, no need to keep looping.
if outcome.stalled {
break;
}
}
errors.extend(outcome.errors.into_iter().map(to_fulfillment_error));
debug!(
"select({} predicates remaining, {} errors) done",