rust/tests/ui/macros/macro-metavar-expr-concat/repetitions.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
284 B
Rust
Raw Normal View History

2024-07-19 19:00:46 -05:00
//@ 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);
}