Skip to content

Commit

Permalink
Merge pull request #1685 from ehuss/fix-weak-keywords
Browse files Browse the repository at this point in the history
Fix weak keywords
  • Loading branch information
traviscross authored Dec 3, 2024
2 parents 270c2b9 + 1dd1c64 commit d77cb38
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ The following keywords are reserved beginning in the 2024 edition.
These keywords have special meaning only in certain contexts. For example, it
is possible to declare a variable or method with the name `union`.

> **<sup>Lexer</sup>**\
> KW_MACRO_RULES : `macro_rules`\
> KW_UNION : `union`\
> KW_STATICLIFETIME : `'static`\
> KW_SAFE : `safe`\
> KW_RAW : `raw`
>
> **<sup>Lexer 2015</sup>**\
> KW_DYN : `dyn`
* `macro_rules` is used to create custom [macros].
* `union` is used to declare a [union] and is only a keyword when used in a
union declaration.
Expand All @@ -116,15 +126,10 @@ is possible to declare a variable or method with the name `union`.

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

> **<sup>Lexer</sup>**\
> KW_MACRO_RULES : `macro_rules`\
> KW_UNION : `union`\
> KW_STATICLIFETIME : `'static`
>
> **<sup>Lexer 2015</sup>**\
> KW_DYN : `dyn`
* `safe` is used for functions and statics, which has meaning in [external blocks].

* `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`).

[items]: items.md
[Variables]: variables.md
[Type parameters]: types/parameters.md
Expand All @@ -139,3 +144,4 @@ is possible to declare a variable or method with the name `union`.
[loop label]: expressions/loop-expr.md#loop-labels
[generic lifetime parameter]: items/generics.md
[external blocks]: items/external-blocks.md
[raw borrow operators]: expressions/operator-expr.md#raw-borrow-operators

0 comments on commit d77cb38

Please sign in to comment.