From e4add45951511f9afe348bf6066a724deb0d3ccf Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 3 Dec 2019 14:59:29 +0100 Subject: Fix #2467 The stand-alone `unify` requires that the type doesn't contain any type variables. So we can't share the code here for now (without more refactoring)... --- crates/ra_hir_ty/src/infer/unify.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_ty/src/infer/unify.rs') diff --git a/crates/ra_hir_ty/src/infer/unify.rs b/crates/ra_hir_ty/src/infer/unify.rs index 8ed2a6090..fe05642ae 100644 --- a/crates/ra_hir_ty/src/infer/unify.rs +++ b/crates/ra_hir_ty/src/infer/unify.rs @@ -167,12 +167,12 @@ impl Canonicalized { } } -pub fn unify(ty1: Canonical<&Ty>, ty2: &Ty) -> Option { +pub fn unify(ty1: &Canonical, ty2: &Canonical) -> Option { let mut table = InferenceTable::new(); let vars = Substs::builder(ty1.num_vars).fill(std::iter::repeat_with(|| table.new_type_var())).build(); let ty_with_vars = ty1.value.clone().subst_bound_vars(&vars); - if !table.unify(&ty_with_vars, ty2) { + if !table.unify(&ty_with_vars, &ty2.value) { return None; } Some( -- cgit v1.2.3