Skip to content

Commit

Permalink
Rollup merge of rust-lang#122683 - tshepang:missing-test, r=Nadrieril
Browse files Browse the repository at this point in the history
add missing test: expected paren or brace in macro
  • Loading branch information
matthiaskrgr authored Mar 18, 2024
2 parents b652055 + 0550afd commit a21fc36
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ui/macros/paren-or-brace-expected.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
macro_rules! foo {
( $( $i:ident ),* ) => {
$[count($i)]
//~^ ERROR expected `(` or `{`, found `[`
//~| ERROR
};
}

fn main() {}
14 changes: 14 additions & 0 deletions tests/ui/macros/paren-or-brace-expected.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a21fc36

Please sign in to comment.