Files
rust/tests/ui/parser/macro/macro-attr-recovery.rs
Josh Triplett 8fb98ef368 mbe: Parse macro derive rules
This handles various kinds of errors, but does not allow applying the
derive yet.

This adds the feature gate `macro_derive`.
2025-08-14 13:53:57 -07:00

20 lines
424 B
Rust

#![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;