@@ -30,7 +30,7 @@ r[macro.decl.syntax]
3030>   ;  ; | ` $ ` ` ( ` _ MacroMatch_ <sup >+</sup > ` ) ` _ MacroRepSep_ <sup >?</sup > _ MacroRepOp_
3131>
3232> _ MacroFragSpec_ :\
33- >   ;  ;   ;  ; ` block ` | ` expr ` | ` ident ` | ` item ` | ` lifetime ` | ` literal ` \
33+ >   ;  ;   ;  ; ` block ` | ` expr ` | ` expr_2021 ` | ` ident ` | ` item ` | ` lifetime ` | ` literal ` \
3434>   ;  ; | ` meta ` | ` pat ` | ` pat_param ` | ` path ` | ` stmt ` | ` tt ` | ` ty ` | ` vis `
3535>
3636> _ MacroRepSep_ :\
@@ -143,7 +143,8 @@ Valid fragment specifiers are:
143143 statements that require semicolons)
144144 * ` pat_param ` : a [ _ PatternNoTopAlt_ ]
145145 * ` pat ` : at least any [ _ PatternNoTopAlt_ ] , and possibly more depending on edition
146- * ` expr ` : an [ _ Expression_ ]
146+ * ` expr ` : an [ _ Expression_ ] except [ _ UnderscoreExpression_ ] and [ _ ConstBlockExpression_ ] (see [ macro.decl.meta.expr-underscore] )
147+ * ` expr_2021 ` : same as ` expr ` (see [ macro.decl.meta.edition2021] )
147148 * ` ty ` : a [ _ Type_ ]
148149 * ` ident ` : an [ IDENTIFIER_OR_KEYWORD] or [ RAW_IDENTIFIER]
149150 * ` path ` : a [ _ TypePath_ ] style path
@@ -175,6 +176,8 @@ r[macro.decl.meta.edition2021]
175176> Before the 2021 edition, they match exactly the same fragments as ` pat_param ` (that is, they accept [ _ PatternNoTopAlt_ ] ).
176177>
177178> The relevant edition is the one in effect for the ` macro_rules! ` definition.
179+ >
180+ > The ` expr_2021 ` fragment specifier exists to maintain backwards compatibility with editions before 2024.
178181
179182## Repetitions
180183
@@ -572,6 +575,7 @@ For more detail, see the [formal specification].
572575[ Repetitions ] : #repetitions
573576[ _Attr_ ] : attributes.md
574577[ _BlockExpression_ ] : expressions/block-expr.md
578+ [ _ConstBlockExpression_ ] : expressions/block-expr.md#const-blocks
575579[ _DelimTokenTree_ ] : macros.md
576580[ _Expression_ ] : expressions.md
577581[ _Item_ ] : items.md
0 commit comments