From 7a7e47eab7323a8e122d9994b2936e50e42a1af2 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 18 Mar 2021 21:53:19 +0100 Subject: Chalkify TraitRef --- crates/hir_ty/src/infer/coerce.rs | 6 ++++-- 1 file changed, 4 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 b1f98c507..b86474ed4 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -8,7 +8,8 @@ use chalk_ir::{Mutability, TyVariableKind}; use hir_def::lang_item::LangItemTarget; use crate::{ - autoderef, traits::Solution, Interner, Obligation, Substitution, TraitRef, Ty, TyKind, + autoderef, to_chalk_trait_id, traits::Solution, Interner, Obligation, Substitution, TraitRef, + Ty, TyKind, }; use super::{InEnvironment, InferenceContext}; @@ -140,7 +141,8 @@ impl<'a> InferenceContext<'a> { .push(from_ty.clone()) .push(to_ty.clone()) .build(); - let trait_ref = TraitRef { trait_: coerce_unsized_trait, substs }; + let trait_ref = + TraitRef { trait_id: to_chalk_trait_id(coerce_unsized_trait), substitution: substs }; let goal = InEnvironment::new(self.trait_env.clone(), Obligation::Trait(trait_ref)); let canonicalizer = self.canonicalizer(); -- cgit v1.2.3