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

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);
}