2024-02-01 05:34:38 -06:00
|
|
|
error[E0282]: type annotations needed
|
2024-04-11 08:15:34 -05:00
|
|
|
--> $DIR/recursive-coroutine-boxed.rs:15:23
|
2024-02-01 05:34:38 -06:00
|
|
|
|
|
|
|
|
LL | let mut gen = Box::pin(foo());
|
|
|
|
| ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Box`
|
2024-02-27 08:57:49 -06:00
|
|
|
LL |
|
2024-02-01 05:34:38 -06:00
|
|
|
LL | let mut r = gen.as_mut().resume(());
|
|
|
|
| ------ type must be known at this point
|
|
|
|
|
|
|
|
|
help: consider specifying the generic argument
|
|
|
|
|
|
|
|
|
LL | let mut gen = Box::<T>::pin(foo());
|
|
|
|
| +++++
|
|
|
|
|
2024-04-02 06:20:03 -05:00
|
|
|
error[E0308]: mismatched types
|
2024-04-11 08:15:34 -05:00
|
|
|
--> $DIR/recursive-coroutine-boxed.rs:14:18
|
2024-04-02 06:20:03 -05:00
|
|
|
|
|
|
|
|
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
|
|
|
|
| ---------------------------------------
|
|
|
|
| |
|
|
|
|
| the expected opaque type
|
|
|
|
| expected `impl Coroutine<Yield = (), Return = ()>` because of return type
|
|
|
|
...
|
2024-04-11 08:15:34 -05:00
|
|
|
LL | #[coroutine] || {
|
|
|
|
| __________________^
|
2024-04-02 06:20:03 -05:00
|
|
|
LL | | let mut gen = Box::pin(foo());
|
|
|
|
LL | |
|
|
|
|
LL | | let mut r = gen.as_mut().resume(());
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^ types differ
|
2024-02-01 05:34:38 -06:00
|
|
|
|
|
2024-04-02 06:20:03 -05:00
|
|
|
= note: expected opaque type `impl Coroutine<Yield = (), Return = ()>`
|
2024-04-11 08:15:34 -05:00
|
|
|
found coroutine `{coroutine@$DIR/recursive-coroutine-boxed.rs:14:18: 14:20}`
|
2024-02-01 05:34:38 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2024-04-02 06:20:03 -05:00
|
|
|
Some errors have detailed explanations: E0282, E0308.
|
|
|
|
For more information about an error, try `rustc --explain E0282`.
|