File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 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
140140used to refer to the current crate; see [ Hygiene] below. Metavariables can be
141141transcribed more than once or not at all.
142142
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+
143149> ** Edition Differences** : Starting with the 2021 edition, ` pat ` fragment-specifiers match top-level or-patterns (that is, they accept [ _ Pattern_ ] ).
144150>
145151> 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].
506512[ _Token_ ] : tokens.md
507513[ _TypePath_ ] : paths.md#paths-in-types
508514[ _Type_ ] : types.md#type-expressions
515+ [ _UnderscoreExpression_ ] : expressions/underscore-expr.md
509516[ _Visibility_ ] : visibility-and-privacy.md
510517[ formal specification ] : macro-ambiguity.md
511518[ token ] : tokens.md
You can’t perform that action at this time.
0 commit comments