completion relevance consider if types can be unified

This commit is contained in:
Josh Mcguigan 2021-03-16 08:45:46 -07:00
parent 20e32fc946
commit 957939292e
5 changed files with 47 additions and 3 deletions

View file

@ -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