1 // The "projection gap" is particularly "fun" around higher-ranked
2 // projections. This is because the current code is hard-coded to say
3 // that a projection that contains escaping regions, like `<T as
4 // Trait2<'y, 'z>>::Foo` where `'z` is bound, can only be found to
5 // outlive a region if all components that appear free (`'y`, where)
6 // outlive that region. However, we DON'T add those components to the
7 // implied bounds set, but rather we treat projections with escaping
8 // regions as opaque entities, just like projections without escaping
13 trait Trait2<'a, 'b> {
17 // As a side-effect of the conservative process above, the type of
18 // this argument `t` is not automatically considered well-formed,
19 // since for it to be WF, we would need to know that `'y: 'x`, but we
21 fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
22 //~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
23 //~| ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied