hir typeck: look into nested goals

uses a `ProofTreeVisitor` to look into nested
goals when looking at the pending obligations
during hir typeck. Used by closure signature
inference, coercion, and for async functions.
This commit is contained in:
lcnr 2024-03-12 14:26:30 +01:00
parent 662eadbafb
commit 03878c682a
23 changed files with 642 additions and 327 deletions

View file

@ -200,18 +200,6 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
}
impl<'tcx> EvalCtxt<'_, 'tcx> {
#[instrument(level = "debug", skip(self))]
fn add_normalizes_to_goal(&mut self, goal: Goal<'tcx, ty::NormalizesTo<'tcx>>) {
inspect::ProofTreeBuilder::add_normalizes_to_goal(self, goal);
self.nested_goals.normalizes_to_goals.push(goal);
}
#[instrument(level = "debug", skip(self))]
fn add_goal(&mut self, source: GoalSource, goal: Goal<'tcx, ty::Predicate<'tcx>>) {
inspect::ProofTreeBuilder::add_goal(self, source, goal);
self.nested_goals.goals.push((source, goal));
}
#[instrument(level = "debug", skip(self, goals))]
fn add_goals(
&mut self,