Skip to content

Commit af90bd4

Browse files
Merge pull request #1010 from ehuss/revert-pat-param
Revert "Temporarily remove pat_param."
2 parents 9c68af3 + 3a6ddea commit af90bd4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/macros-by-example.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
>
2929
> _MacroFragSpec_ :\
3030
>       `block` | `expr` | `ident` | `item` | `lifetime` | `literal`\
31-
>    | `meta` | `pat` | `path` | `stmt` | `tt` | `ty` | `vis`
31+
>    | `meta` | `pat` | `pat_param` | `path` | `stmt` | `tt` | `ty` | `vis`
3232
>
3333
> _MacroRepSep_ :\
3434
> &nbsp;&nbsp; [_Token_]<sub>_except delimiters and repetition operators_</sub>
@@ -122,7 +122,8 @@ fragment specifiers are:
122122
* `block`: a [_BlockExpression_]
123123
* `stmt`: a [_Statement_] without the trailing semicolon (except for item
124124
statements that require semicolons)
125-
* `pat`: a [_PatternNoTopAlt_]
125+
* `pat_param`: a [_PatternNoTopAlt_]
126+
* `pat`: equivalent to `pat_param`
126127
* `expr`: an [_Expression_]
127128
* `ty`: a [_Type_]
128129
* `ident`: an [IDENTIFIER_OR_KEYWORD]
@@ -450,7 +451,7 @@ Matchers like `$i:expr,` or `$i:expr;` would be legal, however, because `,` and
450451
`;` are legal expression separators. The specific rules are:
451452

452453
* `expr` and `stmt` may only be followed by one of: `=>`, `,`, or `;`.
453-
* `pat` may only be followed by one of: `=>`, `,`, `=`, `|`, `if`, or `in`.
454+
* `pat` and `pat_param` may only be followed by one of: `=>`, `,`, `=`, `|`, `if`, or `in`.
454455
* `path` and `ty` may only be followed by one of: `=>`, `,`, `=`, `|`, `;`,
455456
`:`, `>`, `>>`, `[`, `{`, `as`, `where`, or a macro variable of `block`
456457
fragment specifier.

0 commit comments

Comments
 (0)