2022-04-17 05:41:49 -05:00
|
|
|
error[E0261]: use of undeclared lifetime name `'a`
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:37: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,`
|
|
|
|
|
2022-07-26 01:19:58 -05:00
|
|
|
error[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:19:5
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
|
|
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
|
2023-02-20 21:58:38 -06:00
|
|
|
| ------ ------------- opaque type defined here
|
|
|
|
| |
|
2023-09-09 01:36:50 -05:00
|
|
|
| hidden type `{closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 19:12}` captures the anonymous lifetime defined here
|
2022-04-17 05:41:49 -05:00
|
|
|
...
|
|
|
|
LL | / move || {
|
|
|
|
LL | |
|
|
|
|
LL | | *dest = g.get();
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2022-10-22 16:38:05 -05:00
|
|
|
help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
|
|
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error[E0311]: the parameter type `G` may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:30:5
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
2023-09-17 09:32:02 -05:00
|
|
|
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
|
|
|
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
|
|
|
|
...
|
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 | | }
|
2023-09-17 09:32:02 -05:00
|
|
|
| |_____^ ...so that the type `G` will meet its required lifetime bounds
|
2022-04-24 10:04:31 -05:00
|
|
|
|
|
2023-10-08 05:06:17 -05:00
|
|
|
help: consider adding an explicit lifetime bound
|
2022-04-30 03:33:37 -05:00
|
|
|
|
|
2023-09-07 20:35:51 -05:00
|
|
|
LL ~ fn bar<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
|
2022-09-05 05:45:53 -05:00
|
|
|
LL | where
|
|
|
|
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-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:52:5
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
2023-09-17 09:32:02 -05:00
|
|
|
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
|
|
|
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
|
|
|
|
...
|
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 | | }
|
2023-09-17 09:32:02 -05:00
|
|
|
| |_____^ ...so that the type `G` will meet its required lifetime bounds
|
2022-04-24 10:04:31 -05:00
|
|
|
|
|
2023-10-08 05:06:17 -05:00
|
|
|
help: consider adding an explicit lifetime bound
|
2022-04-30 03:33:37 -05:00
|
|
|
|
|
2023-09-07 20:35:51 -05:00
|
|
|
LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b
|
|
|
|
| +++ ++++ ++ ~~
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
|
|
error[E0311]: the parameter type `G` may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:61:9
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
2023-09-17 09:32:02 -05:00
|
|
|
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
|
|
|
|
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
|
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 | | }
|
2023-09-17 09:32:02 -05:00
|
|
|
| |_________^ ...so that the type `G` will meet its required lifetime bounds
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
2023-10-08 05:06:17 -05:00
|
|
|
help: consider adding an explicit lifetime bound
|
2022-04-30 03:33:37 -05:00
|
|
|
|
|
2023-09-07 20:35:51 -05:00
|
|
|
LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &'c mut T) -> impl FnOnce() + 'c {
|
|
|
|
| +++ ++++ ++ ~~
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
|
|
error[E0311]: the parameter type `G` may not live long enough
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:73:5
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
2023-09-17 09:32:02 -05:00
|
|
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
|
|
|
|
| ------ the parameter type `G` must be valid for the anonymous lifetime defined here...
|
|
|
|
...
|
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 | | }
|
2023-09-17 09:32:02 -05:00
|
|
|
| |_____^ ...so that the type `G` will meet its required lifetime bounds
|
2022-04-24 10:04:31 -05:00
|
|
|
|
|
2023-10-08 05:06:17 -05:00
|
|
|
help: consider adding an explicit lifetime bound
|
2022-04-30 03:33:37 -05:00
|
|
|
|
|
2023-09-07 20:35:51 -05:00
|
|
|
LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &'b mut T) -> impl FnOnce() + 'b + 'a
|
|
|
|
| +++ ++++ ++ ~~
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
|
|
error[E0621]: explicit lifetime required in the type of `dest`
|
2022-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:73: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-04-01 12:13:25 -05:00
|
|
|
--> $DIR/missing-lifetimes-in-signature.rs:85:5
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
2023-09-17 09:32:02 -05:00
|
|
|
LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
|
|
|
|
| -- the parameter type `G` must be valid for the lifetime `'a` as defined here...
|
|
|
|
...
|
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
|
|
|
|
|
2023-10-08 05:06:17 -05:00
|
|
|
help: consider adding an explicit lifetime bound
|
2022-04-30 03:33:37 -05:00
|
|
|
|
|
|
|
|
LL | G: Get<T> + 'a,
|
|
|
|
| ++++
|
2022-04-17 05:41:49 -05:00
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
|
2022-08-19 06:06:47 -05:00
|
|
|
Some errors have detailed explanations: E0261, E0309, E0311, E0621, E0700.
|
2022-04-17 05:41:49 -05:00
|
|
|
For more information about an error, try `rustc --explain E0261`.
|