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

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

20 lines
432 B
Rust
Raw Normal View History

2024-07-06 16:00:04 -05:00
//@ run-pass
#![feature(macro_metavar_expr_concat)]
macro_rules! turn_to_page {
2024-07-17 15:00:48 -05:00
($ident:ident, $literal:literal, $tt:tt) => {
2024-07-06 16:00:04 -05:00
const ${concat("", $ident)}: i32 = 394;
2024-07-17 15:00:48 -05:00
const ${concat("", $literal)}: i32 = 394;
const ${concat("", $tt)}: i32 = 394;
2024-07-06 16:00:04 -05:00
};
}
fn main() {
2024-07-17 15:00:48 -05:00
turn_to_page!(P1, "Ṕ2", );
assert_eq!(, 394);
assert_eq!(P1, 394);
assert_eq!(2, 394);
2024-07-06 16:00:04 -05:00
}