Skip to content

Commit e4e6d3b

Browse files
committed
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.
1 parent 2585fd6 commit e4e6d3b

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/keywords.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ r[lex.keywords.strict.list]
2727
The following keywords are in all editions:
2828

2929
- `as`
30+
- `async`
31+
- `await`
3032
- `break`
3133
- `const`
3234
- `continue`
3335
- `crate`
36+
- `dyn`
3437
- `else`
3538
- `enum`
3639
- `extern`
@@ -63,11 +66,12 @@ The following keywords are in all editions:
6366
- `while`
6467

6568
r[lex.keywords.strict.edition2018]
66-
The following keywords were added beginning in the 2018 edition.
67-
68-
- `async`
69-
- `await`
70-
- `dyn`
69+
> [!EDITION-2018]
70+
> The following keywords were added in the 2018 edition:
71+
>
72+
> - `async`
73+
> - `await`
74+
> - `dyn`
7175
7276
r[lex.keywords.reserved]
7377
## Reserved keywords
@@ -84,23 +88,23 @@ r[lex.keywords.reserved.list]
8488
- `box`
8589
- `do`
8690
- `final`
91+
- `gen`
8792
- `macro`
8893
- `override`
8994
- `priv`
95+
- `try`
9096
- `typeof`
9197
- `unsized`
9298
- `virtual`
9399
- `yield`
94100

95101
r[lex.keywords.reserved.edition2018]
96-
The following keywords are reserved beginning in the 2018 edition.
97-
98-
- `try`
102+
> [!EDITION-2018]
103+
> The `try` keyword was added as a reserved keyword in the 2018 edition.
99104
100105
r[lex.keywords.reserved.edition2024]
101-
The following keywords are reserved beginning in the 2024 edition.
102-
103-
- `gen`
106+
> [!EDITION-2024]
107+
> The `gen` keyword was added as a reserved keyword in the 2024 edition.
104108
105109
r[lex.keywords.weak]
106110
## Weak keywords

0 commit comments

Comments
 (0)