2018-08-07 03:54:51 +00:00
|
|
|
macro_rules! foo {
|
2018-08-08 05:28:09 +00: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-07 03:54:51 +00:00
|
|
|
}
|
|
|
|
|
2018-07-15 06:50:08 +00:00
|
|
|
fn main() {
|
|
|
|
println!("{}" a);
|
2018-08-07 03:54:51 +00:00
|
|
|
//~^ ERROR expected token: `,`
|
|
|
|
foo!(a b);
|
|
|
|
//~^ ERROR no rules expected the token `b`
|
2018-08-08 05:28:09 +00: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-15 06:50:08 +00:00
|
|
|
}
|