diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index d443b124c41..21b1a8e4a5e 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -2223,8 +2223,8 @@ impl Type { walk_type(db, self, &mut cb); } - pub fn could_unify_with(&self, other: &Type) -> bool { - could_unify(&self.ty, &other.ty) + pub fn could_unify_with(&self, db: &dyn HirDatabase, other: &Type) -> bool { + could_unify(db, self.env.clone(), &self.ty, &other.ty) } } diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs index 1a762d3dc1f..6b04ee16487 100644 --- a/crates/ide_completion/src/render.rs +++ b/crates/ide_completion/src/render.rs @@ -323,7 +323,7 @@ fn compute_type_match( if completion_ty == expected_type { Some(CompletionRelevanceTypeMatch::Exact) - } else if expected_type.could_unify_with(completion_ty) { + } else if expected_type.could_unify_with(ctx.db, completion_ty) { Some(CompletionRelevanceTypeMatch::CouldUnify) } else { None