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_ty/src/infer/unify.rs | |
parent | 48c492af7ec8ff6af4fe2b38f83aa007c9f7f0b8 (diff) |
Fix HIR expecting errors to unify with anything
Diffstat (limited to 'crates/hir_ty/src/infer/unify.rs')
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 56e06b7d0..d8edfb4e9 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs | |||
@@ -86,8 +86,12 @@ impl<T: HasInterner<Interner = Interner>> Canonicalized<T> { | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | pub fn could_unify(db: &dyn HirDatabase, env: Arc<TraitEnvironment>, t1: &Ty, t2: &Ty) -> bool { | 89 | pub fn could_unify( |
90 | InferenceTable::new(db, env).unify(t1, t2) | 90 | db: &dyn HirDatabase, |
91 | env: Arc<TraitEnvironment>, | ||
92 | tys: &Canonical<(Ty, Ty)>, | ||
93 | ) -> bool { | ||
94 | unify(db, env, tys).is_some() | ||
91 | } | 95 | } |
92 | 96 | ||
93 | pub(crate) fn unify( | 97 | pub(crate) fn unify( |