mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
4e418805da
Partially address #71039.
19 lines
536 B
Rust
19 lines
536 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 type `(String)`
|
|
//~| ERROR macro expansion ignores token `(String)` and any following
|
|
|
|
values!(STRING(1) as (String) => cfg(test),);
|
|
//~^ ERROR expected one of `!` or `::`, found `<eof>`
|
|
|
|
fn main() {}
|