2021-02-12 21:51:00 +09:00
|
|
|
error[E0311]: the parameter type `T` may not live long enough
|
2022-12-26 15:43:31 -08:00
|
|
|
--> $DIR/missing-lifetimes-in-signature-2.rs:23:5
|
2021-02-12 21:51:00 +09:00
|
|
|
|
|
|
|
|
LL | / foo.bar(move |_| {
|
|
|
|
LL | |
|
|
|
|
LL | | t.test();
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
|
|
|
|
|
2021-10-05 12:11:51 +00:00
|
|
|
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
|
2022-12-26 15:43:31 -08:00
|
|
|
--> $DIR/missing-lifetimes-in-signature-2.rs:22:24
|
2021-02-12 21:51:00 +09:00
|
|
|
|
|
|
|
|
LL | fn func<T: Test>(foo: &Foo, t: T) {
|
2021-02-21 18:38:20 +09:00
|
|
|
| ^^^
|
2022-04-24 17:04:31 +02:00
|
|
|
note: ...so that the type `T` will meet its required lifetime bounds
|
2022-12-26 15:43:31 -08:00
|
|
|
--> $DIR/missing-lifetimes-in-signature-2.rs:23:5
|
2022-04-24 17:04:31 +02:00
|
|
|
|
|
|
|
|
LL | / foo.bar(move |_| {
|
|
|
|
LL | |
|
|
|
|
LL | | t.test();
|
|
|
|
LL | | });
|
|
|
|
| |______^
|
2022-04-30 10:33:37 +02:00
|
|
|
help: consider adding an explicit lifetime bound...
|
|
|
|
|
|
2022-12-26 15:43:31 -08:00
|
|
|
LL | fn func<'a, T: Test + 'a>(foo: &'a Foo<'a>, t: T) {
|
|
|
|
| +++ ++++ ++ ++++
|
2021-02-12 21:51:00 +09:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2022-08-19 07:06:47 -04:00
|
|
|
For more information about this error, try `rustc --explain E0311`.
|