rust/tests/ui/impl-trait/recursive-coroutine-boxed.next.stderr

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

37 lines
1.6 KiB
Plaintext
Raw Normal View History

error[E0282]: type annotations needed
2024-10-14 12:04:10 -05:00
--> $DIR/recursive-coroutine-boxed.rs:16:23
|
LL | let mut gen = Box::pin(foo());
| ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Box`
2024-10-14 12:04:10 -05: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-10-14 09:52:34 -05:00
error[E0277]: the size for values of type `impl Coroutine<Yield = (), Return = ()>` cannot be known at compilation time
--> $DIR/recursive-coroutine-boxed.rs:9:13
|
LL | fn foo() -> impl Coroutine<Yield = (), Return = ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `impl Coroutine<Yield = (), Return = ()>`
= note: the return type of a function must have a statically known size
error[E0277]: the size for values of type `impl Coroutine<Yield = (), Return = ()>` cannot be known at compilation time
2024-10-14 12:04:10 -05:00
--> $DIR/recursive-coroutine-boxed.rs:16:32
2024-10-14 09:52:34 -05:00
|
LL | let mut gen = Box::pin(foo());
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `impl Coroutine<Yield = (), Return = ()>`
= note: the return type of a function must have a statically known size
2024-10-14 12:04:10 -05:00
error: aborting due to 3 previous errors
2024-10-14 12:04:10 -05:00
Some errors have detailed explanations: E0277, E0282.
For more information about an error, try `rustc --explain E0277`.