Skip to content

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

Closed
@goffrie

Description

@goffrie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.D-editionDiagnostics: An error or lint that should account for edition differences.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