|
| 1 | +error[E0658]: anonymous lifetimes in `impl Trait` are unstable |
| 2 | + --> $DIR/impl-trait-missing-lifetime-gated.rs:5:31 |
| 3 | + | |
| 4 | +LL | fn f(_: impl Iterator<Item = &'_ ()>) {} |
| 5 | + | ^^ |
| 6 | + | |
| 7 | + = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable |
| 8 | + |
| 9 | +error[E0106]: missing lifetime specifier |
| 10 | + --> $DIR/impl-trait-missing-lifetime-gated.rs:8:50 |
| 11 | + | |
| 12 | +LL | fn g(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() } |
| 13 | + | ^^ expected named lifetime parameter |
| 14 | + | |
| 15 | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments |
| 16 | +help: consider using the `'static` lifetime |
| 17 | + | |
| 18 | +LL | fn g(x: impl Iterator<Item = &'_ ()>) -> Option<&'static ()> { x.next() } |
| 19 | + | ~~~~~~~ |
| 20 | + |
| 21 | +error[E0658]: anonymous lifetimes in `impl Trait` are unstable |
| 22 | + --> $DIR/impl-trait-missing-lifetime-gated.rs:8:31 |
| 23 | + | |
| 24 | +LL | fn g(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() } |
| 25 | + | ^^ |
| 26 | + | |
| 27 | + = help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable |
| 28 | + |
| 29 | +error[E0106]: missing lifetime specifier |
| 30 | + --> $DIR/impl-trait-missing-lifetime-gated.rs:18:56 |
| 31 | + | |
| 32 | +LL | async fn i(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() } |
| 33 | + | ^^ expected named lifetime parameter |
| 34 | + | |
| 35 | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments |
| 36 | +help: consider using the `'static` lifetime |
| 37 | + | |
| 38 | +LL | async fn i(x: impl Iterator<Item = &'_ ()>) -> Option<&'static ()> { x.next() } |
| 39 | + | ~~~~~~~ |
| 40 | + |
| 41 | +error: aborting due to 4 previous errors |
| 42 | + |
| 43 | +Some errors have detailed explanations: E0106, E0658. |
| 44 | +For more information about an error, try `rustc --explain E0106`. |
0 commit comments