dedup GoalEvaluationStep and GoalCandidate

also handle 2 panics when dumping proof trees for the whole test suite

- need to actually tell the proof tree builder about overflow
- need to handle a recursion_limit of 0 :<
This commit is contained in:
lcnr 2023-09-11 15:48:04 +02:00
parent 8225a2e9ec
commit eac55eec9e
5 changed files with 75 additions and 56 deletions

View file

@ -233,9 +233,9 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
#[instrument(level = "debug", skip(self, goals))]
fn add_goals(&mut self, goals: impl IntoIterator<Item = Goal<'tcx, ty::Predicate<'tcx>>>) {
let current_len = self.nested_goals.goals.len();
self.nested_goals.goals.extend(goals);
debug!("added_goals={:?}", &self.nested_goals.goals[current_len..]);
for goal in goals {
self.add_goal(goal);
}
}
/// Try to merge multiple possible ways to prove a goal, if that is not possible returns `None`.