fn get<T>(_:T){}
fn post<T>(_:T){}
pub mod a{
pub mod b{
pub struct C;
}
}
macro_rules! call_methods {
($($m:ident), + => $($a:ident)::*) => {
{
$($m($($a)::*));+
}
};
}
fn main(){
call_methods!(get, post => a::b::C);
}
I expect that the macro invocation call_methods!(get, post => a::b::C);
will be expanded to
{
get(a::b::C); post(a::b::C);
}
However, the compiler cannot compile this code and reports an error:
error: meta-variable
m
repeats 2 times, buta
repeats 3 times
Why are these meta-variables not expanded on their own separately?