From 7e541e69b1eaab3c242c864a0930cb263d2cbaf5 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 3 Apr 2021 17:49:29 +0200 Subject: Add HasInterner bounds --- crates/hir_ty/src/infer/unify.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'crates/hir_ty/src/infer') diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 2ea9dd920..3732d8ebd 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -2,7 +2,9 @@ use std::borrow::Cow; -use chalk_ir::{FloatTy, IntTy, TyVariableKind, UniverseIndex, VariableKind}; +use chalk_ir::{ + interner::HasInterner, FloatTy, IntTy, TyVariableKind, UniverseIndex, VariableKind, +}; use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; use super::{DomainGoal, InferenceContext}; @@ -34,7 +36,10 @@ where } #[derive(Debug)] -pub(super) struct Canonicalized { +pub(super) struct Canonicalized +where + T: HasInterner, +{ pub(super) value: Canonical, free_vars: Vec<(InferenceVar, TyVariableKind)>, } @@ -76,7 +81,10 @@ impl<'a, 'b> Canonicalizer<'a, 'b> { ) } - fn into_canonicalized(self, result: T) -> Canonicalized { + fn into_canonicalized>( + self, + result: T, + ) -> Canonicalized { let kinds = self .free_vars .iter() @@ -108,7 +116,7 @@ impl<'a, 'b> Canonicalizer<'a, 'b> { } } -impl Canonicalized { +impl> Canonicalized { pub(super) fn decanonicalize_ty(&self, ty: Ty) -> Ty { ty.fold_binders( &mut |ty, binders| { -- cgit v1.2.3