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/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/hir/src') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 05a60e158..4ee08ef21 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -51,7 +51,7 @@ use hir_def::{ }; use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind}; use hir_ty::{ - autoderef, + autoderef, could_unify, method_resolution::{self, TyFingerprint}, primitive::UintTy, to_assoc_type_id, @@ -2154,6 +2154,10 @@ impl Type { walk_type(db, self, &mut cb); } + + pub fn could_unify_with(&self, other: &Type) -> bool { + could_unify(&self.ty, &other.ty) + } } // FIXME: closures -- cgit v1.2.3