Skip to content

Commit 3af7576

Browse files
paulstansifercatamorphism
authored andcommitted
Be a bit more explicit about the nature of macro RHSes.
1 parent b84caef commit 3af7576

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/tutorial-macros.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ transcriber (therefore `() => ((1,2,3))` is a macro that expands to a tuple
117117
expression, `() => (let $x=$val)` is a macro that expands to a statement, and
118118
`() => (1,2,3)` is a macro that expands to a syntax errror).
119119

120+
Except for permissibility of `$name` (and `$(...)*`, discussed below), the
121+
right-hand side of a macro definition follows the same rules as ordinary
122+
Rust syntax. In particular, macro invocations (including invocations of the
123+
macro currently being defined) are permitted in expression, statement, and
124+
item locations.
125+
120126
## Interpolation location
121127

122128
The interpolation `$argument_name` may appear in any location consistent with

0 commit comments

Comments
 (0)