Switch Chalk to recursive solver
+ various fixes related to that.
This commit is contained in:
@@ -16,10 +16,12 @@ use self::chalk::{from_chalk, Interner, ToChalk};
|
||||
pub(crate) mod chalk;
|
||||
mod builtin;
|
||||
|
||||
/// This controls the maximum size of types Chalk considers. If we set this too
|
||||
/// high, we can run into slow edge cases; if we set it too low, Chalk won't
|
||||
/// find some solutions.
|
||||
const CHALK_SOLVER_MAX_SIZE: usize = 10;
|
||||
// This controls the maximum size of types Chalk considers. If we set this too
|
||||
// high, we can run into slow edge cases; if we set it too low, Chalk won't
|
||||
// find some solutions.
|
||||
// FIXME this is currently hardcoded in the recursive solver
|
||||
// const CHALK_SOLVER_MAX_SIZE: usize = 10;
|
||||
|
||||
/// This controls how much 'time' we give the Chalk solver before giving up.
|
||||
const CHALK_SOLVER_FUEL: i32 = 100;
|
||||
|
||||
@@ -30,8 +32,7 @@ struct ChalkContext<'a> {
|
||||
}
|
||||
|
||||
fn create_chalk_solver() -> chalk_solve::Solver<Interner> {
|
||||
let solver_choice =
|
||||
chalk_solve::SolverChoice::SLG { max_size: CHALK_SOLVER_MAX_SIZE, expected_answers: None };
|
||||
let solver_choice = chalk_solve::SolverChoice::recursive();
|
||||
solver_choice.into_solver()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user