From 957939292ec9038f139bd10e093e9673609eea04 Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Tue, 16 Mar 2021 08:45:46 -0700 Subject: completion relevance consider if types can be unified --- crates/hir_ty/src/infer/unify.rs | 4 ++++ 1 file changed, 4 insertions(+) (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 75250a369..6e7b0f5a6 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -157,6 +157,10 @@ impl Canonicalized { } } +pub fn could_unify(t1: &Ty, t2: &Ty) -> bool { + InferenceTable::new().unify(t1, t2) +} + pub(crate) fn unify(tys: &Canonical<(Ty, Ty)>) -> Option { let mut table = InferenceTable::new(); let vars = Substitution( -- cgit v1.2.3