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/infer/coerce.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/infer/coerce.rs') diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index 159a53a63..f1af2a0bd 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -7,7 +7,7 @@ use chalk_ir::{cast::Cast, Mutability, TyVariableKind}; use hir_def::lang_item::LangItemTarget; -use crate::{autoderef, Interner, Solution, Ty, TyBuilder, TyExt, TyKind}; +use crate::{autoderef, Canonical, Interner, Solution, Ty, TyBuilder, TyExt, TyKind}; use super::{InEnvironment, InferenceContext}; @@ -148,7 +148,14 @@ impl<'a> InferenceContext<'a> { match solution { Solution::Unique(v) => { - canonicalized.apply_solution(self, v.0); + canonicalized.apply_solution( + self, + Canonical { + binders: v.binders, + // FIXME handle constraints + value: v.value.subst, + }, + ); } _ => return None, }; -- cgit v1.2.3