Add test for #8931 and better checking

This commit is contained in:
Florian Diebold 2021-05-23 12:52:41 +02:00
parent bc1ba1549d
commit a5d85a6356
3 changed files with 114 additions and 13 deletions

View file

@ -2053,7 +2053,7 @@ impl Type {
name: Option<&Name>,
mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>,
) -> Option<T> {
let canonical = hir_ty::replace_errors_with_variables(self.ty.clone());
let canonical = hir_ty::replace_errors_with_variables(&self.ty);
let env = self.env.clone();
let krate = krate.id;
@ -2222,7 +2222,7 @@ impl Type {
}
pub fn could_unify_with(&self, db: &dyn HirDatabase, other: &Type) -> bool {
let tys = hir_ty::replace_errors_with_variables((self.ty.clone(), other.ty.clone()));
let tys = hir_ty::replace_errors_with_variables(&(self.ty.clone(), other.ty.clone()));
could_unify(db, self.env.clone(), &tys)
}
}