Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/render.rs')
-rw-r--r--crates/ide-completion/src/render.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ide-completion/src/render.rs b/crates/ide-completion/src/render.rs
index dc7eacbfba..d9f3fe1326 100644
--- a/crates/ide-completion/src/render.rs
+++ b/crates/ide-completion/src/render.rs
@@ -628,11 +628,9 @@ fn compute_ref_match(
let expected_type = ctx.expected_type.as_ref()?;
let expected_without_ref = expected_type.remove_ref();
let completion_without_ref = completion_ty.remove_ref();
-
- if completion_ty == expected_type {
+ if expected_type.could_unify_with(ctx.db, completion_ty) {
return None;
}
-
if let Some(expected_without_ref) = &expected_without_ref {
if completion_ty.autoderef(ctx.db).any(|ty| ty == *expected_without_ref) {
cov_mark::hit!(suggest_ref);