diff options
Diffstat (limited to 'crates/hir_ty/src/traits.rs')
-rw-r--r-- | crates/hir_ty/src/traits.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/hir_ty/src/traits.rs b/crates/hir_ty/src/traits.rs index 1cda72d22..5f8666d90 100644 --- a/crates/hir_ty/src/traits.rs +++ b/crates/hir_ty/src/traits.rs | |||
@@ -9,20 +9,16 @@ use stdx::panic_context; | |||
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | db::HirDatabase, AliasEq, AliasTy, Canonical, DomainGoal, Guidance, HirDisplay, InEnvironment, | 11 | db::HirDatabase, AliasEq, AliasTy, Canonical, DomainGoal, Guidance, HirDisplay, InEnvironment, |
12 | Solution, TraitRefExt, Ty, TyKind, WhereClause, | 12 | Solution, TraitRefExt, Ty, TyKind, WhereClause, Interner, |
13 | }; | 13 | }; |
14 | 14 | ||
15 | use self::chalk::Interner; | ||
16 | |||
17 | pub(crate) mod chalk; | ||
18 | |||
19 | /// This controls how much 'time' we give the Chalk solver before giving up. | 15 | /// This controls how much 'time' we give the Chalk solver before giving up. |
20 | const CHALK_SOLVER_FUEL: i32 = 100; | 16 | const CHALK_SOLVER_FUEL: i32 = 100; |
21 | 17 | ||
22 | #[derive(Debug, Copy, Clone)] | 18 | #[derive(Debug, Copy, Clone)] |
23 | struct ChalkContext<'a> { | 19 | pub(crate) struct ChalkContext<'a> { |
24 | db: &'a dyn HirDatabase, | 20 | pub(crate) db: &'a dyn HirDatabase, |
25 | krate: CrateId, | 21 | pub(crate) krate: CrateId, |
26 | } | 22 | } |
27 | 23 | ||
28 | fn create_chalk_solver() -> chalk_recursive::RecursiveSolver<Interner> { | 24 | fn create_chalk_solver() -> chalk_recursive::RecursiveSolver<Interner> { |
@@ -148,7 +144,7 @@ fn solve( | |||
148 | // don't set the TLS for Chalk unless Chalk debugging is active, to make | 144 | // don't set the TLS for Chalk unless Chalk debugging is active, to make |
149 | // extra sure we only use it for debugging | 145 | // extra sure we only use it for debugging |
150 | let solution = | 146 | let solution = |
151 | if is_chalk_debug() { chalk::tls::set_current_program(db, solve) } else { solve() }; | 147 | if is_chalk_debug() { crate::tls::set_current_program(db, solve) } else { solve() }; |
152 | 148 | ||
153 | solution | 149 | solution |
154 | } | 150 | } |