Skip to content

async/await: Compiler talks about async generators when the old await macro is used #60723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Matthias247 opened this issue May 11, 2019 · 1 comment

Comments

@Matthias247
Copy link
Contributor

This error confused me when trying to convert async/await code to latest nightly:

This function:

#![feature(async_await)] 

async fn produces_error() {
    r#await!(1);
}

produces the following diagnostic:

error[E0658]: macro r#await! is unstable
 --> src/lib.rs:4:5
  |
4 |     r#await!(1);
  |     ^^^^^^^^^^^^
  |
  = note: for more information, see https://github.com/rust-lang/rust/issues/50547
  = help: add #![feature(await_macro)] to the crate attributes to enable

error[E0727]: `async` generators are not yet supported
 --> src/lib.rs:3:27
  |
3 |   async fn produces_error() {
  |  ___________________________^
4 | |     r#await!(1);
5 | | }
  | |_^

error: aborting due to 2 previous errors

I was mostly confused what it had to do with async generators, since there is no generator involved. Tracking it back to the old await! wasn't obvious, since for my case that one was hidden in the "old" version of futures-rs select! macro. Thereby using select! lead to an error message which was hard to understand.

I guess this will go away once the old await macro is removed.

@Matthias247
Copy link
Contributor Author

I just figured out that seems to be a duplicate of #60660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant