diff options
Diffstat (limited to 'tests/ui/macros/syntax-error-recovery.rs')
-rw-r--r-- | tests/ui/macros/syntax-error-recovery.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/macros/syntax-error-recovery.rs b/tests/ui/macros/syntax-error-recovery.rs new file mode 100644 index 000000000..ae6de3c50 --- /dev/null +++ b/tests/ui/macros/syntax-error-recovery.rs @@ -0,0 +1,18 @@ +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 `(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() {} |