rust/tests/ui/macros/macro-metavar-expr-concat/unicode-expansion.rs
2024-07-17 17:00:48 -03:00

20 lines
432 B
Rust

//@ run-pass
#![feature(macro_metavar_expr_concat)]
macro_rules! turn_to_page {
($ident:ident, $literal:literal, $tt:tt) => {
const ${concat("", $ident)}: i32 = 394;
const ${concat("", $literal)}: i32 = 394;
const ${concat("", $tt)}: i32 = 394;
};
}
fn main() {
turn_to_page!(P1, "Ṕ2", );
assert_eq!(, 394);
assert_eq!(P1, 394);
assert_eq!(2, 394);
}