aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2020-04-10 16:44:43 +0100
committerFlorian Diebold <[email protected]>2020-04-16 12:06:23 +0100
commit14570df015d1641d1e382c9898e7c6d981b99e97 (patch)
treeeb89057f63b5b85c029b2caa6a6cf22a834d67f4 /crates/ra_hir_ty/src/traits.rs
parent364415b7d66bc9d42f21181d7f642e9f911c4711 (diff)
Switch Chalk to recursive solver
+ various fixes related to that.
Diffstat (limited to 'crates/ra_hir_ty/src/traits.rs')
-rw-r--r--crates/ra_hir_ty/src/traits.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs
index 44fbdb197..05791a848 100644
--- a/crates/ra_hir_ty/src/traits.rs
+++ b/crates/ra_hir_ty/src/traits.rs
@@ -16,10 +16,12 @@ use self::chalk::{from_chalk, Interner, ToChalk};
16pub(crate) mod chalk; 16pub(crate) mod chalk;
17mod builtin; 17mod builtin;
18 18
19/// This controls the maximum size of types Chalk considers. If we set this too 19// This controls the maximum size of types Chalk considers. If we set this too
20/// high, we can run into slow edge cases; if we set it too low, Chalk won't 20// high, we can run into slow edge cases; if we set it too low, Chalk won't
21/// find some solutions. 21// find some solutions.
22const CHALK_SOLVER_MAX_SIZE: usize = 10; 22// FIXME this is currently hardcoded in the recursive solver
23// const CHALK_SOLVER_MAX_SIZE: usize = 10;
24
23/// This controls how much 'time' we give the Chalk solver before giving up. 25/// This controls how much 'time' we give the Chalk solver before giving up.
24const CHALK_SOLVER_FUEL: i32 = 100; 26const CHALK_SOLVER_FUEL: i32 = 100;
25 27
@@ -30,8 +32,7 @@ struct ChalkContext<'a> {
30} 32}
31 33
32fn create_chalk_solver() -> chalk_solve::Solver<Interner> { 34fn create_chalk_solver() -> chalk_solve::Solver<Interner> {
33 let solver_choice = 35 let solver_choice = chalk_solve::SolverChoice::recursive();
34 chalk_solve::SolverChoice::SLG { max_size: CHALK_SOLVER_MAX_SIZE, expected_answers: None };
35 solver_choice.into_solver() 36 solver_choice.into_solver()
36} 37}
37 38