rust/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr

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

167 lines
5.2 KiB
Plaintext
Raw Normal View History

2022-04-17 05:41:49 -05:00
error[E0261]: use of undeclared lifetime name `'a`
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:42:11
2022-04-17 05:41:49 -05:00
|
LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `'a,`
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:23:5
2022-04-17 05:41:49 -05:00
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
2022-05-22 00:36:12 -05:00
| ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:23:5: 26:6]` captures the anonymous lifetime defined here
2022-04-17 05:41:49 -05:00
...
LL | / move || {
LL | |
LL | | *dest = g.get();
LL | | }
| |_____^
|
help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ++++
error[E0311]: the parameter type `G` may not live long enough
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:35:5
2022-04-17 05:41:49 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-17 05:41:49 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^
|
note: the parameter type `G` must be valid for the anonymous lifetime defined here...
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:30:26
2022-04-17 05:41:49 -05:00
|
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ^^^^^^
2022-04-24 10:04:31 -05:00
note: ...so that the type `G` will meet its required lifetime bounds
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:35:5
2022-04-24 10:04:31 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-24 10:04:31 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^
2022-04-30 03:33:37 -05:00
help: consider adding an explicit lifetime bound...
|
LL | G: Get<T> + 'a,
| ++++
2022-04-17 05:41:49 -05:00
error[E0311]: the parameter type `G` may not live long enough
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:58:5
2022-04-17 05:41:49 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-17 05:41:49 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^
|
note: the parameter type `G` must be valid for the anonymous lifetime defined here...
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:53:34
2022-04-17 05:41:49 -05:00
|
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ^^^^^^
2022-04-24 10:04:31 -05:00
note: ...so that the type `G` will meet its required lifetime bounds
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:58:5
2022-04-24 10:04:31 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-24 10:04:31 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^
2022-04-30 03:33:37 -05:00
help: consider adding an explicit lifetime bound...
|
LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ++++
2022-04-17 05:41:49 -05:00
error[E0311]: the parameter type `G` may not live long enough
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:68:9
2022-04-17 05:41:49 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-17 05:41:49 -05:00
LL | | *dest = g.get();
LL | | }
| |_________^
|
note: the parameter type `G` must be valid for the anonymous lifetime defined here...
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:66:47
2022-04-17 05:41:49 -05:00
|
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
| ^^^^^^
2022-04-24 10:04:31 -05:00
note: ...so that the type `G` will meet its required lifetime bounds
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:68:9
2022-04-24 10:04:31 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-24 10:04:31 -05:00
LL | | *dest = g.get();
LL | | }
| |_________^
2022-04-30 03:33:37 -05:00
help: consider adding an explicit lifetime bound...
|
LL | fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
| ++++
2022-04-17 05:41:49 -05:00
error[E0311]: the parameter type `G` may not live long enough
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:81:5
2022-04-17 05:41:49 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
LL | |
2022-04-17 05:41:49 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^
|
note: the parameter type `G` must be valid for the anonymous lifetime defined here...
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:76:34
2022-04-17 05:41:49 -05:00
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ^^^^^^
2022-04-24 10:04:31 -05:00
note: ...so that the type `G` will meet its required lifetime bounds
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:81:5
2022-04-24 10:04:31 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
LL | |
2022-04-24 10:04:31 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^
2022-04-30 03:33:37 -05:00
help: consider adding an explicit lifetime bound...
|
LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ++++
2022-04-17 05:41:49 -05:00
error[E0621]: explicit lifetime required in the type of `dest`
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:81:5
2022-04-17 05:41:49 -05:00
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
...
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
LL | |
2022-04-17 05:41:49 -05:00
LL | | *dest = g.get();
LL | | }
| |_____^ lifetime `'a` required
error[E0309]: the parameter type `G` may not live long enough
2022-05-22 00:36:12 -05:00
--> $DIR/missing-lifetimes-in-signature.rs:94:5
2022-04-17 05:41:49 -05:00
|
LL | / move || {
2022-05-22 00:36:12 -05:00
LL | |
2022-04-17 05:41:49 -05:00
LL | | *dest = g.get();
LL | | }
2022-04-24 10:04:31 -05:00
| |_____^ ...so that the type `G` will meet its required lifetime bounds
2022-04-30 03:33:37 -05:00
|
help: consider adding an explicit lifetime bound...
|
LL | G: Get<T> + 'a,
| ++++
2022-04-17 05:41:49 -05:00
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0261, E0309, E0621, E0700.
For more information about an error, try `rustc --explain E0261`.