From e4e6d3bc6e77889d37ecf5282382d69b813717cf Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 12 Oct 2025 09:23:30 -0700 Subject: [PATCH] Follow edition formatting for keywords This updates the keywords chapter to follow our style guide where the main text is supposed to describe the current edition, with admonitions that describe differences to previous editions. --- src/keywords.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/keywords.md b/src/keywords.md index 2fd8046f1..cbcfbcf4c 100644 --- a/src/keywords.md +++ b/src/keywords.md @@ -27,10 +27,13 @@ r[lex.keywords.strict.list] The following keywords are in all editions: - `as` +- `async` +- `await` - `break` - `const` - `continue` - `crate` +- `dyn` - `else` - `enum` - `extern` @@ -63,11 +66,12 @@ The following keywords are in all editions: - `while` r[lex.keywords.strict.edition2018] -The following keywords were added beginning in the 2018 edition. - -- `async` -- `await` -- `dyn` +> [!EDITION-2018] +> The following keywords were added in the 2018 edition: +> +> - `async` +> - `await` +> - `dyn` r[lex.keywords.reserved] ## Reserved keywords @@ -84,23 +88,23 @@ r[lex.keywords.reserved.list] - `box` - `do` - `final` +- `gen` - `macro` - `override` - `priv` +- `try` - `typeof` - `unsized` - `virtual` - `yield` r[lex.keywords.reserved.edition2018] -The following keywords are reserved beginning in the 2018 edition. - -- `try` +> [!EDITION-2018] +> The `try` keyword was added as a reserved keyword in the 2018 edition. r[lex.keywords.reserved.edition2024] -The following keywords are reserved beginning in the 2024 edition. - -- `gen` +> [!EDITION-2024] +> The `gen` keyword was added as a reserved keyword in the 2024 edition. r[lex.keywords.weak] ## Weak keywords