rust/tests/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr

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

31 lines
919 B
Plaintext
Raw Normal View History

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