rust/tests/ui/impl-trait/recursive-coroutine-boxed.n...

41 lines
1.4 KiB
Plaintext

error[E0282]: type annotations needed
--> $DIR/recursive-coroutine-boxed.rs:15: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:14:18
|
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
| ---------------------------------------
| |
| the expected opaque type
| expected `impl Coroutine<Yield = (), Return = ()>` because of return type
...
LL | #[coroutine] || {
| __________________^
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:14:18: 14:20}`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0282, E0308.
For more information about an error, try `rustc --explain E0282`.