rust/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs
2024-07-19 21:00:46 -03:00

19 lines
284 B
Rust

//@ run-pass
#![feature(macro_metavar_expr_concat)]
macro_rules! one_rep {
( $($a:ident)* ) => {
$(
const ${concat($a, Z)}: i32 = 3;
)*
};
}
fn main() {
one_rep!(A B C);
assert_eq!(AZ, 3);
assert_eq!(BZ, 3);
assert_eq!(CZ, 3);
}