40 lines
1.4 KiB
Plaintext
40 lines
1.4 KiB
Plaintext
error[E0282]: type annotations needed
|
|
--> $DIR/recursive-coroutine-boxed.rs:14:23
|
|
|
|
|
LL | let mut gen = Box::pin(foo());
|
|
| ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Box`
|
|
LL |
|
|
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());
|
|
| +++++
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/recursive-coroutine-boxed.rs:13:5
|
|
|
|
|
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
|
|
| ---------------------------------------
|
|
| |
|
|
| the expected opaque type
|
|
| expected `impl Coroutine<Yield = (), Return = ()>` because of return type
|
|
...
|
|
LL | / || {
|
|
LL | | let mut gen = Box::pin(foo());
|
|
LL | |
|
|
LL | | let mut r = gen.as_mut().resume(());
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^ types differ
|
|
|
|
|
= note: expected opaque type `impl Coroutine<Yield = (), Return = ()>`
|
|
found coroutine `{coroutine@$DIR/recursive-coroutine-boxed.rs:13:5: 13:7}`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors have detailed explanations: E0282, E0308.
|
|
For more information about an error, try `rustc --explain E0282`.
|