aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/unify.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/infer/unify.rs')
-rw-r--r--crates/hir_ty/src/infer/unify.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs
index 75250a369..6e7b0f5a6 100644
--- a/crates/hir_ty/src/infer/unify.rs
+++ b/crates/hir_ty/src/infer/unify.rs
@@ -157,6 +157,10 @@ impl<T> Canonicalized<T> {
157 } 157 }
158} 158}
159 159
160pub fn could_unify(t1: &Ty, t2: &Ty) -> bool {
161 InferenceTable::new().unify(t1, t2)
162}
163
160pub(crate) fn unify(tys: &Canonical<(Ty, Ty)>) -> Option<Substitution> { 164pub(crate) fn unify(tys: &Canonical<(Ty, Ty)>) -> Option<Substitution> {
161 let mut table = InferenceTable::new(); 165 let mut table = InferenceTable::new();
162 let vars = Substitution( 166 let vars = Substitution(