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.

20 lines
754 B
Plaintext
Raw Normal View History

2021-02-12 21:51:00 +09:00
error[E0311]: the parameter type `T` may not live long enough
--> $DIR/missing-lifetimes-in-signature-2.rs:23:5
2021-02-12 21:51:00 +09:00
|
2023-09-17 14:32:02 +00:00
LL | fn func<T: Test>(_dummy: &Foo, foo: &Foo, t: T) {
| --- the parameter type `T` must be valid for the anonymous lifetime defined here...
2021-02-12 21:51:00 +09:00
LL | / foo.bar(move |_| {
LL | |
LL | | t.test();
LL | | });
2023-09-17 14:32:02 +00:00
| |______^ ...so that the type `T` will meet its required lifetime bounds
2021-02-12 21:51:00 +09: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 func<'a, T: Test + 'a>(_dummy: &Foo, foo: &Foo<'a>, t: T) {
| +++ ++++ ++++
2021-02-12 21:51:00 +09:00
error: aborting due to 1 previous error
2021-02-12 21:51:00 +09:00
2022-08-19 07:06:47 -04:00
For more information about this error, try `rustc --explain E0311`.