X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_infer%2Fsrc%2Ftraits%2Futil.rs;h=cd5bde2a791309c6c0f6d5aa6d73a55e412e0e36;hb=d65f60d2767816805111ee406e7f36a723e1cfcb;hp=4ada7b22d084c3891b3ffacf89d8e2eb53fa763c;hpb=aaa9bb9e7bb4b8b565f2e1570587d6c21b13ab2d;p=rust.git diff --git a/compiler/rustc_infer/src/traits/util.rs b/compiler/rustc_infer/src/traits/util.rs index 4ada7b22d08..cd5bde2a791 100644 --- a/compiler/rustc_infer/src/traits/util.rs +++ b/compiler/rustc_infer/src/traits/util.rs @@ -261,14 +261,15 @@ fn elaborate(&mut self, obligation: &PredicateObligation<'tcx>) { Component::UnresolvedInferenceVariable(_) => None, - Component::Alias(kind, data) => { - let ty = tcx.mk_ty(ty::Alias(kind, data)); + Component::Alias(alias_ty) => { + // We might end up here if we have `Foo<::Assoc>: 'a`. + // With this, we can deduce that `::Assoc: 'a`. Some(ty::PredicateKind::Clause(ty::Clause::TypeOutlives( - ty::OutlivesPredicate(ty, r_min), + ty::OutlivesPredicate(alias_ty.to_ty(tcx), r_min), ))) } - Component::EscapingProjection(_) => { + Component::EscapingAlias(_) => { // We might be able to do more here, but we don't // want to deal with escaping vars right now. None