-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
A-edition-2018Area: The 2018 editionArea: The 2018 editionF-rust_2018_preview`#![feature(rust_2018_preview)]``#![feature(rust_2018_preview)]`P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamWG-epochWorking group: Epoch (2018) managementWorking group: Epoch (2018) management
Description
We intend for await to be a keyword in the 2018 edition, this causes a tricky problem: currently, await! is a macro, not using "normal" control flow syntax, because we haven't decided exactly how the syntax should work (see the RFC unresolved questions for more context). But macros are not supposed to be able to have keywords as names.
It's now the case that not only does std have an await! macro, but other libraries are defining them also to handle compatibility between different versions of futures, specifically tokio-async-await.
I propose this solution to the problem:
- On 2018,
awaitis a true keyword - a macro namedawaitwould be invalid. - Under the
await_macrofeature, theawaitkeyword is disabled, allowing users (including std) to useawaitas a macro name. - Before we stabilize async/await, we resolve the syntactic question for
awaitand makeawaita keyword again. This will break anyone usingawaitas a macro name, but they were already on nightly, and expected this breakage.
This avoids special casing std await!, making the behavior on stable for 2018 simple and allowing tokio-async-await to keep its await! macro.
Metadata
Metadata
Assignees
Labels
A-edition-2018Area: The 2018 editionArea: The 2018 editionF-rust_2018_preview`#![feature(rust_2018_preview)]``#![feature(rust_2018_preview)]`P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamWG-epochWorking group: Epoch (2018) managementWorking group: Epoch (2018) management