Rollup merge of #122683 - tshepang:missing-test, r=Nadrieril

add missing test: expected paren or brace in macro
This commit is contained in:
Matthias Krüger 2024-03-18 16:27:10 +01:00 committed by GitHub
commit 1eb49ec5b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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