rust/tests/ui/macros/syntax-error-recovery.rs
Nicholas Nethercote 4c0cbaeb9e Remove TokenStream::flattened and InvisibleOrigin::FlattenToken.
They are no longer needed.

This does slightly worsen the error message for a single test, but that
test contains code that is so badly broken that I'm not worried about
it.
2025-04-02 16:16:51 +11:00

18 lines
563 B
Rust

macro_rules! values {
($($token:ident($value:literal) $(as $inner:ty)? => $attr:meta,)*) => {
#[derive(Debug)]
pub enum TokenKind {
$(
#[$attr]
$token $($inner)? = $value,
//~^ ERROR expected one of `!` or `::`, found `<eof>`
)*
}
};
}
//~^^^^^^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `ty` metavariable
//~| ERROR macro expansion ignores `ty` metavariable and any tokens following
values!(STRING(1) as (String) => cfg(test),);
fn main() {}