2024-03-22 03:02:12 -05:00
|
|
|
error[E0792]: expected generic lifetime parameter, found `'static`
|
2024-03-28 01:11:09 -05:00
|
|
|
--> $DIR/non-defining-use-lifetimes.rs:13:16
|
2023-10-21 11:28:51 -05:00
|
|
|
|
|
2024-03-22 03:02:12 -05:00
|
|
|
LL | fn foo<'a>(_: Lt<'a>) -> impl Sized + 'a {
|
|
|
|
| -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
|
2023-10-21 11:28:51 -05:00
|
|
|
LL | let _: () = foo(Lt::<'static>::None);
|
|
|
|
| ^^
|
|
|
|
|
2024-03-18 11:03:18 -05:00
|
|
|
error[E0792]: expected generic lifetime parameter, found `'_`
|
2024-03-28 01:11:09 -05:00
|
|
|
--> $DIR/non-defining-use-lifetimes.rs:22:16
|
2024-03-18 11:03:18 -05:00
|
|
|
|
|
|
|
|
LL | fn foo<'a>(_: Lt<'a>) -> impl Sized + 'a {
|
|
|
|
| -- this generic parameter must be used with a generic lifetime parameter
|
|
|
|
LL | let _: () = foo(Lt::<'_>::None);
|
|
|
|
| ^^
|
|
|
|
|
2024-03-22 03:02:12 -05:00
|
|
|
error: non-defining opaque type use in defining scope
|
2024-03-28 01:11:09 -05:00
|
|
|
--> $DIR/non-defining-use-lifetimes.rs:32:16
|
2023-10-21 11:28:51 -05:00
|
|
|
|
|
|
|
|
LL | let _: () = foo(Lt::<'a>::None, Lt::<'a>::None);
|
|
|
|
| ^^
|
2024-03-22 03:02:12 -05:00
|
|
|
|
|
|
|
|
note: lifetime used multiple times
|
2024-03-28 01:11:09 -05:00
|
|
|
--> $DIR/non-defining-use-lifetimes.rs:31:58
|
2024-03-22 03:02:12 -05:00
|
|
|
|
|
|
|
|
LL | fn foo<'a, 'b>(_: Lt<'a>, _: Lt<'b>) -> impl Sized + 'a + 'b {
|
|
|
|
| ^^ ^^
|
2023-10-21 11:28:51 -05:00
|
|
|
|
2024-03-18 11:03:18 -05:00
|
|
|
error: aborting due to 3 previous errors
|
2023-10-21 11:28:51 -05:00
|
|
|
|
2024-03-18 11:03:18 -05:00
|
|
|
For more information about this error, try `rustc --explain E0792`.
|