diff options
author | Florian Diebold <[email protected]> | 2021-05-15 19:28:07 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-05-21 16:48:34 +0100 |
commit | 8397734cfe26793d3e9f9ec5f8392655a4b8e106 (patch) | |
tree | 4ccb4df2b209ea6a50332be32265accaffe08211 /crates/hir/src/lib.rs | |
parent | 48c492af7ec8ff6af4fe2b38f83aa007c9f7f0b8 (diff) |
Fix HIR expecting errors to unify with anything
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r-- | crates/hir/src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 21b1a8e4a..1429384cb 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -2051,11 +2051,7 @@ impl Type { | |||
2051 | name: Option<&Name>, | 2051 | name: Option<&Name>, |
2052 | mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, | 2052 | mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, |
2053 | ) -> Option<T> { | 2053 | ) -> Option<T> { |
2054 | // There should be no inference vars in types passed here | 2054 | let canonical = hir_ty::replace_errors_with_variables(self.ty.clone()); |
2055 | // FIXME check that? | ||
2056 | // FIXME replace Unknown by bound vars here | ||
2057 | let canonical = | ||
2058 | Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(&Interner) }; | ||
2059 | 2055 | ||
2060 | let env = self.env.clone(); | 2056 | let env = self.env.clone(); |
2061 | let krate = krate.id; | 2057 | let krate = krate.id; |
@@ -2224,7 +2220,8 @@ impl Type { | |||
2224 | } | 2220 | } |
2225 | 2221 | ||
2226 | pub fn could_unify_with(&self, db: &dyn HirDatabase, other: &Type) -> bool { | 2222 | pub fn could_unify_with(&self, db: &dyn HirDatabase, other: &Type) -> bool { |
2227 | could_unify(db, self.env.clone(), &self.ty, &other.ty) | 2223 | let tys = hir_ty::replace_errors_with_variables((self.ty.clone(), other.ty.clone())); |
2224 | could_unify(db, self.env.clone(), &tys) | ||
2228 | } | 2225 | } |
2229 | } | 2226 | } |
2230 | 2227 | ||