I'm trying to create a macro to expand a set of names and define fields for a struct:
macro_rules! expand {
($($name:ident),*) => {
pub struct Test {
$(
concat_idents!(var_, $name) : Vec<$name>
),*
}
}
}
//fails
expand!(a,b,c);
This fails as the compiler does not recognize concat_idents!
as a macro. How am I supposed to work around this?