Skip to content

E0308 for coroutines kinda cryptic #118954

Open
@matthiaskrgr

Description

@matthiaskrgr

Code

#![feature(coroutines)]
#![crate_type="lib"]

async fn async_fn() -> i32 {
    move || {
        yield 1_u32;
    }
}

Current output

error[E0308]: mismatched types
 --> 94BA3E9349D8E32F911462C954A9A278963282E62BF874B0EED4F13C0EFFE468.rs:5:5
  |
5 | /     move || {
6 | |         yield 1_u32;
7 | |     }
  | |_____^ expected `i32`, found coroutine
  |
  = note:   expected type `i32`
          found coroutine `{coroutine@94BA3E9349D8E32F911462C954A9A278963282E62BF874B0EED4F13C0EFFE468.rs:5:5: 5:12}`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.

Desired output

`found coroutine<u32>`   or something like that?

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coroutinesArea: CoroutinesA-diagnosticsArea: Messages for errors, warnings, and lintsF-coroutines`#![feature(coroutines)]`S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions