From 209c492432c15b017f99dba06d5937389c1f9546 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 11 Jul 2020 15:22:46 +0200 Subject: Upgrade Chalk --- crates/ra_hir_ty/src/traits.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_ty/src/traits.rs') diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs index 2a6d7faef..786f758e9 100644 --- a/crates/ra_hir_ty/src/traits.rs +++ b/crates/ra_hir_ty/src/traits.rs @@ -2,6 +2,7 @@ use std::sync::Arc; use chalk_ir::cast::Cast; +use chalk_solve::Solver; use hir_def::{ expr::ExprId, lang_item::LangItemTarget, DefWithBodyId, ImplId, TraitId, TypeAliasId, }; @@ -32,9 +33,10 @@ struct ChalkContext<'a> { krate: CrateId, } -fn create_chalk_solver() -> chalk_solve::Solver { - let solver_choice = chalk_solve::SolverChoice::recursive(); - solver_choice.into_solver() +fn create_chalk_solver() -> chalk_recursive::RecursiveSolver { + let overflow_depth = 100; + let caching_enabled = true; + chalk_recursive::RecursiveSolver::new(overflow_depth, caching_enabled) } /// A set of clauses that we assume to be true. E.g. if we are inside this function: -- cgit v1.2.3 From 2a4166501d8990d3a489e89af3d92002540c288c Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 11 Jul 2020 16:29:09 +0200 Subject: Remove built-in Unsize impls They exist in Chalk now. --- crates/ra_hir_ty/src/traits.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'crates/ra_hir_ty/src/traits.rs') diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs index 786f758e9..f7edb4c8b 100644 --- a/crates/ra_hir_ty/src/traits.rs +++ b/crates/ra_hir_ty/src/traits.rs @@ -295,13 +295,8 @@ pub enum Impl { /// A normal impl from an impl block. ImplDef(ImplId), /// Closure types implement the Fn traits synthetically. + // FIXME: implement closure support from Chalk, remove this ClosureFnTraitImpl(ClosureFnTraitImplData), - /// [T; n]: Unsize<[T]> - UnsizeArray, - /// T: Unsize where T: Trait - UnsizeToTraitObject(TraitId), - /// dyn Trait: Unsize if Trait: SuperTrait - UnsizeToSuperTraitObject(UnsizeToSuperTraitObjectData), } /// This exists just for Chalk, because our ImplIds are only unique per module. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -- cgit v1.2.3