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 don't get expanded when used in item name token position #4365
All of the examples below fail to compile with an error similar to the following:
test.rs:1:16: 1:17 error: expected ( but found !
test.rs:1 fn concat_idents!(foo, bar) () {}
^
fn concat_idents!(foo, bar) () {}
trait concat_idents!(foo, bar) {}
mod concat_idents!(foo, bar) {}
let concat_idents!(foo, bar) = 0;
Hmm, ok, I see. I failed to grok the following sentence during my first ten readings of the Macro Tutorial: "A macro invocation may take the place of (and therefore expand to) either an expression, an item, or a statement".
Too bad, this makes concat_idents!() way less useful than I thought...
Activity
vadimcn commentedon Jan 10, 2013
Hmm, ok, I see. I failed to grok the following sentence during my first ten readings of the Macro Tutorial: "A macro invocation may take the place of (and therefore expand to) either an expression, an item, or a statement".
Too bad, this makes concat_idents!() way less useful than I thought...
catamorphism commentedon Jan 10, 2013
I don't think we're planning to extend the macro system in this way, but feel free to make another issue requesting it as an RFC :-)
Merge rust-lang#4365