Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/inspect.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/inspect.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crates/hir-ty/src/next_solver/inspect.rs b/crates/hir-ty/src/next_solver/inspect.rs index 5286977549..63a225b98f 100644 --- a/crates/hir-ty/src/next_solver/inspect.rs +++ b/crates/hir-ty/src/next_solver/inspect.rs @@ -1,5 +1,3 @@ -pub(crate) use rustc_next_trait_solver::solve::inspect::*; - use rustc_ast_ir::try_visit; use rustc_next_trait_solver::{ canonical::instantiate_canonical_state, @@ -329,10 +327,6 @@ impl<'a, 'db> InspectGoal<'a, 'db> { self.result } - pub(crate) fn source(&self) -> GoalSource { - self.source - } - pub(crate) fn depth(&self) -> usize { self.depth } @@ -464,9 +458,10 @@ impl<'a, 'db> InspectGoal<'a, 'db> { pub(crate) fn visit_with<V: ProofTreeVisitor<'db>>(&self, visitor: &mut V) -> V::Result { if self.depth < visitor.config().max_depth { try_visit!(visitor.visit_goal(self)); + V::Result::output() + } else { + visitor.on_recursion_limit() } - - V::Result::output() } } @@ -479,6 +474,10 @@ pub(crate) trait ProofTreeVisitor<'db> { } fn visit_goal(&mut self, goal: &InspectGoal<'_, 'db>) -> Self::Result; + + fn on_recursion_limit(&mut self) -> Self::Result { + Self::Result::output() + } } impl<'db> InferCtxt<'db> { |