From 8397734cfe26793d3e9f9ec5f8392655a4b8e106 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 15 May 2021 20:28:07 +0200 Subject: Fix HIR expecting errors to unify with anything --- crates/hir_ty/src/infer/unify.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/infer/unify.rs') diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 56e06b7d0..d8edfb4e9 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -86,8 +86,12 @@ impl> Canonicalized { } } -pub fn could_unify(db: &dyn HirDatabase, env: Arc, t1: &Ty, t2: &Ty) -> bool { - InferenceTable::new(db, env).unify(t1, t2) +pub fn could_unify( + db: &dyn HirDatabase, + env: Arc, + tys: &Canonical<(Ty, Ty)>, +) -> bool { + unify(db, env, tys).is_some() } pub(crate) fn unify( -- cgit v1.2.3