mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
completion relevance consider if types can be unified
This commit is contained in:
parent
20e32fc946
commit
957939292e
5 changed files with 47 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue