diff options
Diffstat (limited to 'compiler/rustc_next_trait_solver')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs index 00fd3ba8046..780feb9b827 100644 --- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs @@ -147,13 +147,9 @@ pub trait SolverDelegateEvalExt: SolverDelegate { fn evaluate_root_goal( &self, goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>, - generate_proof_tree: GenerateProofTree, span: <Self::Interner as Interner>::Span, stalled_on: Option<GoalStalledOn<Self::Interner>>, - ) -> ( - Result<GoalEvaluation<Self::Interner>, NoSolution>, - Option<inspect::GoalEvaluation<Self::Interner>>, - ); + ) -> Result<GoalEvaluation<Self::Interner>, NoSolution>; /// Check whether evaluating `goal` with a depth of `root_depth` may /// succeed. This only returns `false` if the goal is guaranteed to @@ -170,17 +166,16 @@ pub trait SolverDelegateEvalExt: SolverDelegate { // FIXME: This is only exposed because we need to use it in `analyse.rs` // which is not yet uplifted. Once that's done, we should remove this. - fn evaluate_root_goal_raw( + fn evaluate_root_goal_for_proof_tree( &self, goal: Goal<Self::Interner, <Self::Interner as Interner>::Predicate>, - generate_proof_tree: GenerateProofTree, - stalled_on: Option<GoalStalledOn<Self::Interner>>, + span: <Self::Interner as Interner>::Span, ) -> ( Result< (NestedNormalizationGoals<Self::Interner>, GoalEvaluation<Self::Interner>), NoSolution, >, - Option<inspect::GoalEvaluation<Self::Interner>>, + inspect::GoalEvaluation<Self::Interner>, ); } @@ -193,13 +188,17 @@ where fn evaluate_root_goal( &self, goal: Goal<I, I::Predicate>, - generate_proof_tree: GenerateProofTree, span: I::Span, stalled_on: Option<GoalStalledOn<I>>, - ) -> (Result<GoalEvaluation<I>, NoSolution>, Option<inspect::GoalEvaluation<I>>) { - EvalCtxt::enter_root(self, self.cx().recursion_limit(), generate_proof_tree, span, |ecx| { - ecx.evaluate_goal(GoalEvaluationKind::Root, GoalSource::Misc, goal, stalled_on) - }) + ) -> Result<GoalEvaluation<I>, NoSolution> { + EvalCtxt::enter_root( + self, + self.cx().recursion_limit(), + GenerateProofTree::No, + span, + |ecx| ecx.evaluate_goal(GoalEvaluationKind::Root, GoalSource::Misc, goal, stalled_on), + ) + .0 } fn root_goal_may_hold_with_depth( @@ -217,24 +216,22 @@ where } #[instrument(level = "debug", skip(self))] - fn evaluate_root_goal_raw( + fn evaluate_root_goal_for_proof_tree( &self, goal: Goal<I, I::Predicate>, - generate_proof_tree: GenerateProofTree, - stalled_on: Option<GoalStalledOn<I>>, + span: I::Span, ) -> ( Result<(NestedNormalizationGoals<I>, GoalEvaluation<I>), NoSolution>, - Option<inspect::GoalEvaluation<I>>, + inspect::GoalEvaluation<I>, ) { - EvalCtxt::enter_root( + let (result, proof_tree) = EvalCtxt::enter_root( self, self.cx().recursion_limit(), - generate_proof_tree, - I::Span::dummy(), - |ecx| { - ecx.evaluate_goal_raw(GoalEvaluationKind::Root, GoalSource::Misc, goal, stalled_on) - }, - ) + GenerateProofTree::Yes, + span, + |ecx| ecx.evaluate_goal_raw(GoalEvaluationKind::Root, GoalSource::Misc, goal, None), + ); + (result, proof_tree.unwrap()) } } |
