2 // gate-test-anonymous_lifetime_in_impl_trait
3 // Verify the behaviour of `feature(anonymous_lifetime_in_impl_trait)`.
5 fn f(_: impl Iterator<Item = &'_ ()>) {}
6 //~^ ERROR anonymous lifetimes in `impl Trait` are unstable
8 fn g(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
9 //~^ ERROR anonymous lifetimes in `impl Trait` are unstable
10 //~| ERROR missing lifetime specifier
12 // Anonymous lifetimes in async fn are already allowed.
13 // This is understood as `fn foo<'_1>(_: impl Iterator<Item = &'_1 ()>) {}`.
14 async fn h(_: impl Iterator<Item = &'_ ()>) {}
16 // Anonymous lifetimes in async fn are already allowed.
17 // But that lifetime does not participate in resolution.
18 async fn i(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
19 //~^ ERROR missing lifetime specifier