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
{{ message }}
Repository navigation
Macros attempting to expand to multiple items silently only expand to the first one #8012
Users who want a macro that expands to a collection items are required to wrap the RHS in {} in order to get them to expand to a whole block. However, if they fail to do so, they unexpectedly just get the first item of the block, rather than an error message.
This source of this problem probably isn't specific to items. I'm worried
that there's a lurking (if minor) usability problem in the lack of erroring
out in this case.
Activity
paulstansifer commentedon Jul 23, 2013
Thanks to
kmcon IRC for reporting this.bstrie commentedon Jul 24, 2013
Perhaps this is really just another plaintive cry for someone to tackle #4375.
huonw commentedon Aug 5, 2013
Smaller testcase:
std: adjust str::test_add so that the macro expands to all 3 items (r…
nejucomo commentedon Sep 29, 2013
I don't understand how this is different than #4375. If not justification for the distinction is given, can we mark this as a duplicate?
paulstansifer commentedon Sep 29, 2013
This source of this problem probably isn't specific to items. I'm worried
that there's a lurking (if minor) usability problem in the lack of erroring
out in this case.
kmcallister commentedon Oct 2, 2013
Yeah,
jason_on IRC provided this example using tuples:syntax: indicate an error when a macro ignores trailing tokens.
auto merge of #9673 : huonw/rust/macros, r=catamorphism
Merge rust-lang#8012