error[E0106]: missing lifetime specifier --> $DIR/impl-trait-missing-lifetime.rs:9:50 | LL | fn g(x: impl Iterator) -> Option<&'_ ()> { x.next() } | ^^ expected named lifetime parameter | = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments help: consider using the `'static` lifetime | LL | fn g(x: impl Iterator) -> Option<&'static ()> { x.next() } | ~~~~~~~ error[E0106]: missing lifetime specifier --> $DIR/impl-trait-missing-lifetime.rs:16:56 | LL | async fn i(x: impl Iterator) -> Option<&'_ ()> { x.next() } | ^^ expected named lifetime parameter | = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments help: consider using the `'static` lifetime | LL | async fn i(x: impl Iterator) -> Option<&'static ()> { x.next() } | ~~~~~~~ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0106`.