From b03969cda92661ad67897fee0ba16c1cc61830ea Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 6 Apr 2021 23:46:32 +0200 Subject: Remove `SolutionVariables`, add ConstrainedSubst analogous to Chalk ... just missing the constraints. --- crates/hir_ty/src/traits/chalk/mapping.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/traits') diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 0536b934e..84abd99b2 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs @@ -11,8 +11,8 @@ use hir_def::{GenericDefId, TypeAliasId}; use crate::{ chalk_ext::ProjectionTyExt, db::HirDatabase, static_lifetime, AliasTy, CallableDefId, - Canonical, DomainGoal, FnPointer, GenericArg, InEnvironment, OpaqueTy, ProjectionTy, - QuantifiedWhereClause, Substitution, TraitRef, Ty, TypeWalk, WhereClause, + Canonical, ConstrainedSubst, DomainGoal, FnPointer, GenericArg, InEnvironment, OpaqueTy, + ProjectionTy, QuantifiedWhereClause, Substitution, TraitRef, Ty, TypeWalk, WhereClause, }; use super::interner::*; @@ -459,6 +459,18 @@ where } } +impl ToChalk for crate::ConstrainedSubst { + type Chalk = chalk_ir::ConstrainedSubst; + + fn to_chalk(self, _db: &dyn HirDatabase) -> Self::Chalk { + unimplemented!() + } + + fn from_chalk(db: &dyn HirDatabase, chalk: Self::Chalk) -> Self { + ConstrainedSubst { subst: from_chalk(db, chalk.subst) } + } +} + pub(super) fn make_binders(value: T, num_vars: usize) -> chalk_ir::Binders where T: HasInterner, -- cgit v1.2.3