@@ -57,6 +57,11 @@ be used as the names of:
57
57
> KW_WHERE : ` where ` \
58
58
> KW_WHILE : ` while `
59
59
60
+ The following keywords were added beginning in the 2018 edition.
61
+
62
+ > ** <sup >Lexer 2018+</sup >** \
63
+ > KW_DYN : ` dyn `
64
+
60
65
## Reserved keywords
61
66
62
67
These keywords aren't used yet, but they are reserved for future use. They have
@@ -78,6 +83,13 @@ them to use these keywords.
78
83
> KW_VIRTUAL : ` virtual ` \
79
84
> KW_YIELD : ` yield `
80
85
86
+ The following keywords are reserved beginning in the 2018 edition.
87
+
88
+ > ** <sup >Lexer 2018+</sup >** \
89
+ > KW_ASYNC : ` async ` \
90
+ > KW_AWAIT : ` await ` \
91
+ > KW_TRY : ` try `
92
+
81
93
## Weak keywords
82
94
83
95
These keywords have special meaning only in certain contexts. For example, it
@@ -92,12 +104,16 @@ is possible to declare a variable or method with the name `union`.
92
104
// error[E0262]: invalid lifetime parameter name: `'static`
93
105
fn invalid_lifetime_parameter<'static>(s: &'static str) -> &'static str { s }
94
106
```
95
- * ` dyn ` denotes a [ trait object ] and is a keyword when used in a type position
107
+ * In the 2015 edition, [ ` dyn ` ] is a keyword when used in a type position
96
108
followed by a path that does not start with ` :: ` .
97
109
110
+ Beginning in the 2018 edition, ` dyn ` has been promoted to a strict keyword.
111
+
98
112
> ** <sup >Lexer</sup >** \
99
113
> KW_UNION : ` union ` \
100
- > KW_STATICLIFETIME : ` 'static ` \
114
+ > KW_STATICLIFETIME : ` 'static `
115
+ >
116
+ > ** <sup >Lexer 2015</sup >** \
101
117
> KW_DYN : ` dyn `
102
118
103
119
[ items ] : items.html
@@ -110,4 +126,4 @@ is possible to declare a variable or method with the name `union`.
110
126
[ Crates ] : crates-and-source-files.html
111
127
[ union ] : items/unions.html
112
128
[ variants ] : items/enumerations.html
113
- [ trait object ] : types.html#trait-objects
129
+ [ `dyn` ] : types.html#trait-objects
0 commit comments