about summary refs log tree commit diff
path: root/tests/ui/parser/macro/bad-macro-definition.rs
blob: 12df6e64bd2ca9e99cea322de97f9054e64ece41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#![crate_type = "lib"]

macro_rules! a { {} => }
//~^ ERROR: macro definition ended unexpectedly

macro_rules! b { 0 => }
//~^ ERROR: macro definition ended unexpectedly
//~| ERROR: invalid macro matcher

macro_rules! c { x => }
//~^ ERROR: macro definition ended unexpectedly
//~| ERROR: invalid macro matcher

macro_rules! d { _ => }
//~^ ERROR: macro definition ended unexpectedly
//~| ERROR: invalid macro matcher

macro_rules! e { {} }
//~^ ERROR: expected `=>`, found end of macro arguments

macro_rules! f {}
//~^ ERROR: macros must contain at least one rule

macro_rules! g { unsafe {} => {} }
//~^ ERROR: `unsafe` is only supported on `attr` rules