-
Couldn't load subscription status.
- Fork 13.9k
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Description
macro_rules! passthru {
($($t:tt)*) => { format_args!("{}", $($t)*) }
}
fn main() {
passthru!({
macro_rules! foo {
($name:expr) => { concat!("hello ", $name) }
}
foo!("rust")
});
}fails with a nonsense "unknown macro variable name". It works if the macro has no captures or if it's defined outside. And you can normally define a macro in an expression.
Somehow related to the format_args! expansion, but it doesn't occur without the intermediate passthru! macro (which represents println!, print!, or format!). And I can't see the expansion because it doesn't get that far.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)