3 // Test that a feature gate is needed to use `impl Trait` as the
4 // return type of an async.
7 impl<T> Trait<'_> for T { }
9 // Fails to recognize that both 'a and 'b are mentioned and should thus be accepted
10 async fn async_ret_impl_trait3<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
11 //~^ ERROR lifetime may not live long enough
15 // Only `'a` permitted in return type, not `'b`.
16 async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> {
17 //~^ ERROR captures lifetime that does not appear in bounds
21 // As above, but `'b: 'a`, so return type can be inferred to `(&'a u8,
23 async fn async_ret_impl_trait2<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a>