Skip to content

Explain editions when trying to use async block in 2015 edition #67204

Closed
@estebank

Description

@estebank

Trying to use an async block in 2015 edition doesn't mention the concept of editions nor pushes the user in the right direction:

error: expected one of `,` or `}`, found `(`
  --> file12.rs:11:18
   |
10 |     let fut = async {
   |               ----- while parsing this struct
11 |         make_unit()?;
   |                  ^ expected one of `,` or `}`

error[E0422]: cannot find struct, variant or union type `async` in this scope
  --> file12.rs:10:15
   |
10 |     let fut = async {
   |               ^^^^^ not found in this scope

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyAsyncAwait-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.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.D-papercutDiagnostics: An error or lint that needs small tweaks.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions