Skip to content
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

Confusing error message for async move in the 2015 edition #74115

Closed
goffrie opened this issue Jul 6, 2020 · 2 comments
Closed

Confusing error message for async move in the 2015 edition #74115

goffrie opened this issue Jul 6, 2020 · 2 comments
Labels
A-async-await Area: Async & Await A-diagnostics Area: Messages for errors, warnings, and lints AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-enhancement Category: An issue proposing an enhancement or a PR with one. D-edition Diagnostics: An error or lint that should account for edition differences. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@goffrie
Copy link
Contributor

goffrie commented Jul 6, 2020

Playground:

fn main() {
    async move { };
}

yields this error:

error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found keyword `move`
 --> src/main.rs:2:11
  |
2 |     async move { };
  |           ^^^^ expected one of 8 possible tokens

#71783 added a hint about the edition for async {}, but it seems that async move {} doesn't get it.

@jonas-schievink jonas-schievink added A-async-await Area: Async & Await A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 6, 2020
@estebank estebank added the D-edition Diagnostics: An error or lint that should account for edition differences. label Jul 7, 2020
@tmandry tmandry added the AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. label Jul 7, 2020
@JohnTitor JohnTitor added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 8, 2020
@veera-sivarajan
Copy link
Contributor

Output on rustc 1.79.0

error: `async move` blocks are only allowed in Rust 2018 or later
 --> <source>:2:5
  |
2 |     async move { };
  |     ^^^^^^^^^^

error: aborting due to 1 previous error

@goffrie
Copy link
Contributor Author

goffrie commented Jul 18, 2024

I agree, this looks fixed.

@goffrie goffrie closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-diagnostics Area: Messages for errors, warnings, and lints AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-enhancement Category: An issue proposing an enhancement or a PR with one. D-edition Diagnostics: An error or lint that should account for edition differences. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants