rust/tests/ui/impl-trait/impl-fn-predefined-lifetimes.stderr
2025-03-19 17:52:53 +01:00

20 lines
771 B
Text

warning: elided lifetime has a name
--> $DIR/impl-fn-predefined-lifetimes.rs:4:48
|
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
| -- lifetime `'a` declared here ^^ this elided lifetime gets resolved as `'a`
|
= note: `#[warn(elided_named_lifetimes)]` on by default
error[E0792]: expected generic lifetime parameter, found `'_`
--> $DIR/impl-fn-predefined-lifetimes.rs:6:9
|
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
| -- this generic parameter must be used with a generic lifetime parameter
LL |
LL | |x| x
| ^
error: aborting due to 1 previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0792`.