diff options
Diffstat (limited to 'crates/ra_hir_ty/src/traits.rs')
-rw-r--r-- | crates/ra_hir_ty/src/traits.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs index 2a6d7faef..f7edb4c8b 100644 --- a/crates/ra_hir_ty/src/traits.rs +++ b/crates/ra_hir_ty/src/traits.rs | |||
@@ -2,6 +2,7 @@ | |||
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use chalk_ir::cast::Cast; | 4 | use chalk_ir::cast::Cast; |
5 | use chalk_solve::Solver; | ||
5 | use hir_def::{ | 6 | use hir_def::{ |
6 | expr::ExprId, lang_item::LangItemTarget, DefWithBodyId, ImplId, TraitId, TypeAliasId, | 7 | expr::ExprId, lang_item::LangItemTarget, DefWithBodyId, ImplId, TraitId, TypeAliasId, |
7 | }; | 8 | }; |
@@ -32,9 +33,10 @@ struct ChalkContext<'a> { | |||
32 | krate: CrateId, | 33 | krate: CrateId, |
33 | } | 34 | } |
34 | 35 | ||
35 | fn create_chalk_solver() -> chalk_solve::Solver<Interner> { | 36 | fn create_chalk_solver() -> chalk_recursive::RecursiveSolver<Interner> { |
36 | let solver_choice = chalk_solve::SolverChoice::recursive(); | 37 | let overflow_depth = 100; |
37 | solver_choice.into_solver() | 38 | let caching_enabled = true; |
39 | chalk_recursive::RecursiveSolver::new(overflow_depth, caching_enabled) | ||
38 | } | 40 | } |
39 | 41 | ||
40 | /// A set of clauses that we assume to be true. E.g. if we are inside this function: | 42 | /// A set of clauses that we assume to be true. E.g. if we are inside this function: |
@@ -293,13 +295,8 @@ pub enum Impl { | |||
293 | /// A normal impl from an impl block. | 295 | /// A normal impl from an impl block. |
294 | ImplDef(ImplId), | 296 | ImplDef(ImplId), |
295 | /// Closure types implement the Fn traits synthetically. | 297 | /// Closure types implement the Fn traits synthetically. |
298 | // FIXME: implement closure support from Chalk, remove this | ||
296 | ClosureFnTraitImpl(ClosureFnTraitImplData), | 299 | ClosureFnTraitImpl(ClosureFnTraitImplData), |
297 | /// [T; n]: Unsize<[T]> | ||
298 | UnsizeArray, | ||
299 | /// T: Unsize<dyn Trait> where T: Trait | ||
300 | UnsizeToTraitObject(TraitId), | ||
301 | /// dyn Trait: Unsize<dyn SuperTrait> if Trait: SuperTrait | ||
302 | UnsizeToSuperTraitObject(UnsizeToSuperTraitObjectData), | ||
303 | } | 300 | } |
304 | /// This exists just for Chalk, because our ImplIds are only unique per module. | 301 | /// This exists just for Chalk, because our ImplIds are only unique per module. |
305 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 302 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |