add missing test: expected paren or brace in macro

This commit is contained in:
Tshepang Mbambo 2024-03-18 14:25:50 +02:00
parent 13abc0ac9b
commit 0550afd97e
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,9 @@
macro_rules! foo {
( $( $i:ident ),* ) => {
$[count($i)]
//~^ ERROR expected `(` or `{`, found `[`
//~| ERROR
};
}
fn main() {}

View file

@ -0,0 +1,14 @@
error: expected `(` or `{`, found `[`
--> $DIR/paren-or-brace-expected.rs:3:10
|
LL | $[count($i)]
| ^^^^^^^^^^^
error: expected one of: `*`, `+`, or `?`
--> $DIR/paren-or-brace-expected.rs:3:10
|
LL | $[count($i)]
| ^^^^^^^^^^^
error: aborting due to 2 previous errors