2018-08-06 20:54:51 -07:00
|
|
|
macro_rules! foo {
|
2018-08-07 22:28:09 -07:00
|
|
|
($a:ident) => ();
|
|
|
|
($a:ident, $b:ident) => ();
|
|
|
|
($a:ident, $b:ident, $c:ident) => ();
|
|
|
|
($a:ident, $b:ident, $c:ident, $d:ident) => ();
|
|
|
|
($a:ident, $b:ident, $c:ident, $d:ident, $e:ident) => ();
|
2018-08-06 20:54:51 -07:00
|
|
|
}
|
|
|
|
|
2018-07-14 23:50:08 -07:00
|
|
|
fn main() {
|
|
|
|
println!("{}" a);
|
2018-08-06 20:54:51 -07:00
|
|
|
//~^ ERROR expected token: `,`
|
|
|
|
foo!(a b);
|
|
|
|
//~^ ERROR no rules expected the token `b`
|
2018-08-07 22:28:09 -07:00
|
|
|
foo!(a, b, c, d e);
|
|
|
|
//~^ ERROR no rules expected the token `e`
|
|
|
|
foo!(a, b, c d, e);
|
|
|
|
//~^ ERROR no rules expected the token `d`
|
|
|
|
foo!(a, b, c d e);
|
|
|
|
//~^ ERROR no rules expected the token `d`
|
2018-07-14 23:50:08 -07:00
|
|
|
}
|