Files
rust/tests/ui/parser/macro/macro-attr-recovery.rs

20 lines
424 B
Rust
Raw Normal View History

#![crate_type = "lib"]
#![feature(macro_attr)]
macro_rules! attr {
attr[$($args:tt)*] { $($body:tt)* } => {
//~^ ERROR: `attr` rule argument matchers require parentheses
//~v ERROR: attr:
compile_error!(concat!(
"attr: args=\"",
stringify!($($args)*),
"\" body=\"",
stringify!($($body)*),
"\"",
));
};
}
#[attr]
struct S;