Files
rust/tests/ui/lifetimes/lifetime-errors/issue_74400.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
2.3 KiB
Plaintext
Raw Normal View History

2021-08-31 11:03:49 +02:00
error[E0310]: the parameter type `T` may not live long enough
2022-04-01 13:13:25 -04:00
--> $DIR/issue_74400.rs:12:5
2021-08-31 11:03:49 +02:00
|
LL | f(data, identity)
2023-09-17 14:32:02 +00:00
| ^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
2022-04-30 10:33:37 +02:00
|
2023-10-08 10:06:17 +00:00
help: consider adding an explicit lifetime bound
2022-04-30 10:33:37 +02:00
|
LL | fn g<T: 'static>(data: &[T]) {
| +++++++++
2021-08-31 11:03:49 +02:00
2022-11-06 19:26:25 +03:00
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/issue_74400.rs:12:5
|
LL | f(data, identity)
| ^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: consider adding an explicit lifetime bound
|
LL | fn g<T: 'static>(data: &[T]) {
| +++++++++
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/issue_74400.rs:12:5
|
LL | f(data, identity)
| ^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: consider adding an explicit lifetime bound
|
LL | fn g<T: 'static>(data: &[T]) {
| +++++++++
error: implementation of `Fn` is not general enough
2022-04-01 13:13:25 -04:00
--> $DIR/issue_74400.rs:12:5
2021-08-31 11:03:49 +02:00
|
LL | f(data, identity)
| ^^^^^^^^^^^^^^^^^ implementation of `Fn` is not general enough
2021-08-31 11:03:49 +02:00
|
= note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `Fn<(&'1 T,)>`, for any lifetime `'1`...
= note: ...but it actually implements `Fn<(&'2 T,)>`, for some specific lifetime `'2`
2021-08-31 11:03:49 +02:00
error: implementation of `FnOnce` is not general enough
2022-04-01 13:13:25 -04:00
--> $DIR/issue_74400.rs:12:5
2021-08-31 11:03:49 +02:00
|
LL | f(data, identity)
| ^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
|
= note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `FnOnce<(&'1 T,)>`, for any lifetime `'1`...
= note: ...but it actually implements `FnOnce<(&'2 T,)>`, for some specific lifetime `'2`
2022-11-06 19:26:25 +03:00
error: aborting due to 5 previous errors
2021-08-31 11:03:49 +02:00
For more information about this error, try `rustc --explain E0310`.