Skip to content

Commit 59b1b9a

Browse files
committed
Check should_continue once per iteration
1 parent 82657b9 commit 59b1b9a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

chalk-recursive/src/recursive.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ impl<I: Interner> chalk_solve::Solver<I> for RecursiveSolver<I> {
143143
goal: &UCanonical<InEnvironment<Goal<I>>>,
144144
should_continue: &dyn std::ops::Fn() -> bool,
145145
) -> Option<chalk_solve::Solution<I>> {
146-
// TODO support should_continue in recursive solver
147146
self.ctx
148147
.solve_root_goal(goal, program, should_continue)
149148
.ok()

chalk-recursive/src/solve.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ pub(super) trait SolveIteration<I: Interner>: SolveDatabase<I> {
4343
minimums: &mut Minimums,
4444
should_continue: impl std::ops::Fn() -> bool + Clone,
4545
) -> Fallible<Solution<I>> {
46+
if !should_continue() {
47+
return Err(NoSolution);
48+
}
49+
4650
let UCanonical {
4751
universes,
4852
canonical:

0 commit comments

Comments
 (0)