28
28
>
29
29
> _ MacroFragSpec_ :\
30
30
>   ;  ;   ;  ; ` block ` | ` expr ` | ` ident ` | ` item ` | ` lifetime ` | ` literal ` \
31
- >   ;  ; | ` meta ` | ` pat ` | ` pat2015 ` | ` pat2021 ` | ` path ` | ` stmt ` | ` tt ` | ` ty ` | ` vis `
31
+ >   ;  ; | ` meta ` | ` pat ` | ` pat_param ` | ` path ` | ` stmt ` | ` tt ` | ` ty ` | ` vis `
32
32
>
33
33
> _ MacroRepSep_ :\
34
34
>   ;  ; [ _ Token_ ] <sub >_ except delimiters and repetition operators_ </sub >
@@ -122,9 +122,8 @@ fragment specifiers are:
122
122
* ` block ` : a [ _ BlockExpression_ ]
123
123
* ` stmt ` : a [ _ Statement_ ] without the trailing semicolon (except for item
124
124
statements that require semicolons)
125
- * ` pat2015 ` : a [ _ PatternNoTopAlt_ ]
126
- * ` pat2021 ` : a [ _ Pattern_ ]
127
- * ` pat ` : equivalent to either ` pat2015 ` or ` pat2021 ` , depending on edition (see note below).
125
+ * ` pat_param ` : a [ _ PatternNoTopAlt_ ]
126
+ * ` pat ` : equivalent to ` pat_param `
128
127
* ` expr ` : an [ _ Expression_ ]
129
128
* ` ty ` : a [ _ Type_ ]
130
129
* ` ident ` : an [ IDENTIFIER_OR_KEYWORD]
@@ -135,11 +134,6 @@ fragment specifiers are:
135
134
* ` vis ` : a possibly empty [ _ Visibility_ ] qualifier
136
135
* ` literal ` : matches ` - ` <sup >?</sup >[ _ LiteralExpression_ ]
137
136
138
- > ** Edition Differences** : In Editions 2015 and 2018, ` pat ` fragment-specifiers
139
- > do not allow top-level or-patterns (i.e. they accept [ _ PatternNoTopAlt_ ] ). In
140
- > Edition 2021, this was changed so that top-level or-patterns are accepted by
141
- > ` pat ` (i.e. [ _ Pattern_ ] ).
142
-
143
137
In the transcriber, metavariables are referred to simply by ` $ ` _ name_ , since
144
138
the fragment kind is specified in the matcher. Metavariables are replaced with
145
139
the syntax element that matched them. The keyword metavariable ` $crate ` can be
@@ -495,7 +489,6 @@ For more detail, see the [formal specification].
495
489
[ _Item_ ] : items.md
496
490
[ _LiteralExpression_ ] : expressions/literal-expr.md
497
491
[ _MetaListIdents_ ] : attributes.md#meta-item-attribute-syntax
498
- [ _Pattern_ ] : patterns.md
499
492
[ _PatternNoTopAlt_ ] : patterns.md
500
493
[ _Statement_ ] : statements.md
501
494
[ _TokenTree_ ] : macros.md#macro-invocation
0 commit comments