jullang f6e7c81061 Add compiler error when trying to use concat metavar expr in repetitions
Replace unimplemented()! with a more helpful compiler error.
2025-09-01 08:27:30 +02:00

22 lines
561 B
Rust

// issue: <https://github.com/rust-lang/rust/issues/140479>
// Ensure a proper compiler error, instead of an ICE occurs.
// FIXME(macro_metavar_expr_concat): this error message could be improved
#![feature(macro_metavar_expr_concat)]
macro_rules! InRepetition {
(
$(
$($arg:ident),+
)+
) => {
$(
$(
${concat(_, $arg)} //~ ERROR nested repetitions with `${concat(...)}` metavariable expressions are not yet supported
)*
)*
};
}
InRepetition!(other);
fn main() {}