rust/tests/ui/parser/macro/macro-attr-recovery.stderr
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

32 lines
914 B
Plaintext

error: `attr` rule argument matchers require parentheses
--> $DIR/macro-attr-recovery.rs:5:9
|
LL | attr[$($args:tt)*] { $($body:tt)* } => {
| ^^^^^^^^^^^^^^
|
help: the delimiters should be `(` and `)`
|
LL - attr[$($args:tt)*] { $($body:tt)* } => {
LL + attr($($args:tt)*) { $($body:tt)* } => {
|
error: attr: args="" body="struct S;"
--> $DIR/macro-attr-recovery.rs:8:9
|
LL | / compile_error!(concat!(
LL | | "attr: args=\"",
LL | | stringify!($($args)*),
LL | | "\" body=\"",
LL | | stringify!($($body)*),
LL | | "\"",
LL | | ));
| |__________^
...
LL | #[attr]
| ------- in this attribute macro expansion
|
= note: this error originates in the attribute macro `attr` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors