diff --git a/src/macros-by-example.md b/src/macros-by-example.md index 9bdb93fce..e164f5717 100644 --- a/src/macros-by-example.md +++ b/src/macros-by-example.md @@ -134,7 +134,7 @@ Valid fragment specifiers are: * `block`: a [BlockExpression] * `expr`: an [Expression] * `expr_2021`: an [Expression] except [UnderscoreExpression] and [ConstBlockExpression] (see [macro.decl.meta.edition2024]) - * `ident`: an [IDENTIFIER_OR_KEYWORD] or [RAW_IDENTIFIER] + * `ident`: an [IDENTIFIER_OR_KEYWORD], [RAW_IDENTIFIER], or `$crate` * `item`: an [Item] * `lifetime`: a [LIFETIME_TOKEN] * `literal`: matches `-`?[LiteralExpression] diff --git a/src/procedural-macros.md b/src/procedural-macros.md index d47ce2a24..c5975ad48 100644 --- a/src/procedural-macros.md +++ b/src/procedural-macros.md @@ -350,8 +350,9 @@ r[macro.proc.token.conversion.to-proc_macro] When passed to a proc-macro - All multi-character operators are broken into single characters. - Lifetimes are broken into a `'` character and an identifier. -- All metavariable substitutions are represented as their underlying token - streams. +- The keyword metavariable `$crate` is passed as a single identifier. +- All other metavariable substitutions are represented as their underlying + token streams. - Such token streams may be wrapped into delimited groups ([`Group`]) with implicit delimiters ([`Delimiter::None`]) when it's necessary for preserving parsing priorities.