// Test that we are able to establish that `>::Output` outlives `'b` here. We need to prove however // that `>::Output` outlives `'a`, so we also have to // prove that `'b: 'a`. trait MyTrait<'a> { type Output; } fn foo1<'a, 'b, T>() -> &'a () where T: MyTrait<'a>, >::Output: 'b, { bar::() //~ ERROR may not live long enough } fn foo2<'a, 'b, T>() -> &'a () where T: MyTrait<'a>, >::Output: 'b, 'b: 'a, { bar::() // OK } fn bar<'a, T>() -> &'a () where T: 'a, { &() } fn main() {}