Closed
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,
await
is a true keyword - a macro namedawait
would be invalid. - Under the
await_macro
feature, theawait
keyword is disabled, allowing users (including std) to useawait
as a macro name. - Before we stabilize async/await, we resolve the syntactic question for
await
and makeawait
a keyword again. This will break anyone usingawait
as 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.