Skip to content

Commit d77cb38

Browse files
authored
Merge pull request #1685 from ehuss/fix-weak-keywords
Fix weak keywords
2 parents 270c2b9 + 1dd1c64 commit d77cb38

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/keywords.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ The following keywords are reserved beginning in the 2024 edition.
100100
These keywords have special meaning only in certain contexts. For example, it
101101
is possible to declare a variable or method with the name `union`.
102102

103+
> **<sup>Lexer</sup>**\
104+
> KW_MACRO_RULES : `macro_rules`\
105+
> KW_UNION : `union`\
106+
> KW_STATICLIFETIME : `'static`\
107+
> KW_SAFE : `safe`\
108+
> KW_RAW : `raw`
109+
>
110+
> **<sup>Lexer 2015</sup>**\
111+
> KW_DYN : `dyn`
112+
103113
* `macro_rules` is used to create custom [macros].
104114
* `union` is used to declare a [union] and is only a keyword when used in a
105115
union declaration.
@@ -116,15 +126,10 @@ is possible to declare a variable or method with the name `union`.
116126

117127
Beginning in the 2018 edition, `dyn` has been promoted to a strict keyword.
118128

119-
> **<sup>Lexer</sup>**\
120-
> KW_MACRO_RULES : `macro_rules`\
121-
> KW_UNION : `union`\
122-
> KW_STATICLIFETIME : `'static`
123-
>
124-
> **<sup>Lexer 2015</sup>**\
125-
> KW_DYN : `dyn`
126129
* `safe` is used for functions and statics, which has meaning in [external blocks].
127130

131+
* `raw` is used for [raw borrow operators], and is only a keyword when matching a raw borrow operator form (such as `&raw const expr` or `&raw mut expr`).
132+
128133
[items]: items.md
129134
[Variables]: variables.md
130135
[Type parameters]: types/parameters.md
@@ -139,3 +144,4 @@ is possible to declare a variable or method with the name `union`.
139144
[loop label]: expressions/loop-expr.md#loop-labels
140145
[generic lifetime parameter]: items/generics.md
141146
[external blocks]: items/external-blocks.md
147+
[raw borrow operators]: expressions/operator-expr.md#raw-borrow-operators

0 commit comments

Comments
 (0)