mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Fix HIR expecting errors to unify with anything
This commit is contained in:
parent
48c492af7e
commit
8397734cfe
3 changed files with 65 additions and 8 deletions
|
@ -2051,11 +2051,7 @@ impl Type {
|
|||
name: Option<&Name>,
|
||||
mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>,
|
||||
) -> Option<T> {
|
||||
// There should be no inference vars in types passed here
|
||||
// FIXME check that?
|
||||
// FIXME replace Unknown by bound vars here
|
||||
let canonical =
|
||||
Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(&Interner) };
|
||||
let canonical = hir_ty::replace_errors_with_variables(self.ty.clone());
|
||||
|
||||
let env = self.env.clone();
|
||||
let krate = krate.id;
|
||||
|
@ -2224,7 +2220,8 @@ impl Type {
|
|||
}
|
||||
|
||||
pub fn could_unify_with(&self, db: &dyn HirDatabase, other: &Type) -> bool {
|
||||
could_unify(db, self.env.clone(), &self.ty, &other.ty)
|
||||
let tys = hir_ty::replace_errors_with_variables((self.ty.clone(), other.ty.clone()));
|
||||
could_unify(db, self.env.clone(), &tys)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue