blob: 936d87f7968248e318f36b74276d07964f125b92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
error[E0311]: the parameter type `T` may not live long enough
--> $DIR/missing-lifetimes-in-signature-2.rs:23:5
|
LL | / foo.bar(move |_| {
LL | |
LL | | t.test();
LL | | });
| |______^
|
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
--> $DIR/missing-lifetimes-in-signature-2.rs:22:24
|
LL | fn func<T: Test>(foo: &Foo, t: T) {
| ^^^
note: ...so that the type `T` will meet its required lifetime bounds
--> $DIR/missing-lifetimes-in-signature-2.rs:23:5
|
LL | / foo.bar(move |_| {
LL | |
LL | | t.test();
LL | | });
| |______^
help: consider adding an explicit lifetime bound...
|
LL | fn func<'a, T: Test + 'a>(foo: &'a Foo<'a>, t: T) {
| +++ ++++ ++ ++++
error: aborting due to previous error
For more information about this error, try `rustc --explain E0311`.
|