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
164
164
transcribed more than once or not at all.
165
165
166
-
r[macro.decl.meta.expr-underscore]
167
-
For reasons of backwards compatibility, though `_`[is also an
168
-
expression][_UnderscoreExpression_], a standalone underscore is not matched by
169
-
the `expr` fragment specifier. However, `_` is matched by the `expr` fragment
170
-
specifier when it appears as a subexpression.
171
-
For the same reason, a standalone [const block] is not matched but it is matched when appearing as a subexpression.
172
-
173
166
r[macro.decl.meta.edition2021]
174
167
> **Edition differences**: Starting with the 2021 edition, `pat` fragment-specifiers match top-level or-patterns (that is, they accept [_Pattern_]).
175
168
>
176
169
> Before the 2021 edition, they match exactly the same fragments as `pat_param` (that is, they accept [_PatternNoTopAlt_]).
177
170
>
178
171
> The relevant edition is the one in effect for the `macro_rules!` definition.
172
+
173
+
r[macro.decl.meta.edition2024]
174
+
> **Edition differences**: Before the 2024 edition, `expr` fragment specifiers do not match [_UnderscoreExpression_] or [_ConstBlockExpression_] at the top level. They are allowed within subexpressions.
179
175
>
180
176
> The `expr_2021` fragment specifier exists to maintain backwards compatibility with editions before 2024.
181
177
@@ -565,7 +561,6 @@ expansions, taking separators into account. This means:
0 commit comments