diff options
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 15 |
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 | } |