File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,12 @@ the syntax element that matched them. The keyword metavariable `$crate` can be
140
140
used to refer to the current crate; see [ Hygiene] below. Metavariables can be
141
141
transcribed more than once or not at all.
142
142
143
+ For reasons of backwards compatibility, although ` _ ` is a (keyword) identifier,
144
+ it is not matched by the ` ident ` fragment specifier. Similarly, though ` _ ` [ is
145
+ also an expression] [ _UnderscoreExpression_ ] , a standalone underscore is not
146
+ matched by the ` expr ` fragment specifier. However, ` _ ` is matched by the ` expr `
147
+ fragment specifier when it appears as a subexpression.
148
+
143
149
> ** Edition Differences** : Starting with the 2021 edition, ` pat ` fragment-specifiers match top-level or-patterns (that is, they accept [ _ Pattern_ ] ).
144
150
>
145
151
> Before the 2021 edition, they match exactly the same fragments as ` pat_param ` (that is, they accept [ _ PatternNoTopAlt_ ] ).
@@ -506,6 +512,7 @@ For more detail, see the [formal specification].
506
512
[ _Token_ ] : tokens.md
507
513
[ _TypePath_ ] : paths.md#paths-in-types
508
514
[ _Type_ ] : types.md#type-expressions
515
+ [ _UnderscoreExpression_ ] : expressions/underscore-expr.md
509
516
[ _Visibility_ ] : visibility-and-privacy.md
510
517
[ formal specification ] : macro-ambiguity.md
511
518
[ token ] : tokens.md
You can’t perform that action at this time.
0 commit comments