You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The keyword metavariable `$crate` can be used to refer to the current crate; see [Hygiene] below. Metavariables can be
163
163
transcribed more than once or not at all.
164
164
165
-
r[macro.decl.meta.expr-underscore]
166
-
For reasons of backwards compatibility, though `_`[is also an
167
-
expression][_UnderscoreExpression_], a standalone underscore is not matched by
168
-
the `expr` fragment specifier. However, `_` is matched by the `expr` fragment
169
-
specifier when it appears as a subexpression.
170
-
For the same reason, a standalone [const block] is not matched but it is matched when appearing as a subexpression.
171
-
172
165
r[macro.decl.meta.edition2021]
173
166
> **Edition differences**: Starting with the 2021 edition, `pat` fragment-specifiers match top-level or-patterns (that is, they accept [_Pattern_]).
174
167
>
175
168
> Before the 2021 edition, they match exactly the same fragments as `pat_param` (that is, they accept [_PatternNoTopAlt_]).
176
169
>
177
170
> The relevant edition is the one in effect for the `macro_rules!` definition.
171
+
172
+
r[macro.decl.meta.edition2024]
173
+
> **Edition differences**: Before the 2024 edition, `expr` fragment specifiers do not match [_UnderscoreExpression_] or [_ConstBlockExpression_] at the top level. They are allowed within subexpressions.
178
174
>
179
175
> The `expr_2021` fragment specifier exists to maintain backwards compatibility with editions before 2024.
180
176
@@ -600,7 +596,6 @@ expansions, taking separators into account. This means:
0 commit comments