aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-03-21 12:22:22 +0000
committerFlorian Diebold <[email protected]>2021-03-21 17:01:14 +0000
commit590c41635952e19c3caae525a827499dbd360049 (patch)
treeeca7c162975ef901b723d255512e61c047e838b8 /crates/hir_ty/src/infer
parent35868c4f7dc479dd5f731a2785ec6a203046ea9c (diff)
Introduce QuantifiedWhereClause and DynTy analogous to Chalk
This introduces a bunch of new binders in lots of places, which we have to be careful about, but we had to add them at some point.
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r--crates/hir_ty/src/infer/unify.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs
index 1fc03c8f4..35b0a2059 100644
--- a/crates/hir_ty/src/infer/unify.rs
+++ b/crates/hir_ty/src/infer/unify.rs
@@ -310,9 +310,18 @@ impl InferenceTable {
310 310
311 (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true, 311 (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true,
312 312
313 (TyKind::Dyn(dyn1), TyKind::Dyn(dyn2)) if dyn1.len() == dyn2.len() => { 313 (TyKind::Dyn(dyn1), TyKind::Dyn(dyn2))
314 for (pred1, pred2) in dyn1.iter().zip(dyn2.iter()) { 314 if dyn1.bounds.skip_binders().interned().len()
315 if !self.unify_preds(pred1, pred2, depth + 1) { 315 == dyn2.bounds.skip_binders().interned().len() =>
316 {
317 for (pred1, pred2) in dyn1
318 .bounds
319 .skip_binders()
320 .interned()
321 .iter()
322 .zip(dyn2.bounds.skip_binders().interned().iter())
323 {
324 if !self.unify_preds(pred1.skip_binders(), pred2.skip_binders(), depth + 1) {
316 return false; 325 return false;
317 } 326 }
318 } 327 }