From 0550afd97e7d93e52249e83152d53f1facb3b823 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Mon, 18 Mar 2024 14:25:50 +0200 Subject: [PATCH] add missing test: expected paren or brace in macro --- tests/ui/macros/paren-or-brace-expected.rs | 9 +++++++++ tests/ui/macros/paren-or-brace-expected.stderr | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/ui/macros/paren-or-brace-expected.rs create mode 100644 tests/ui/macros/paren-or-brace-expected.stderr diff --git a/tests/ui/macros/paren-or-brace-expected.rs b/tests/ui/macros/paren-or-brace-expected.rs new file mode 100644 index 00000000000..1776fa78884 --- /dev/null +++ b/tests/ui/macros/paren-or-brace-expected.rs @@ -0,0 +1,9 @@ +macro_rules! foo { + ( $( $i:ident ),* ) => { + $[count($i)] + //~^ ERROR expected `(` or `{`, found `[` + //~| ERROR + }; +} + +fn main() {} diff --git a/tests/ui/macros/paren-or-brace-expected.stderr b/tests/ui/macros/paren-or-brace-expected.stderr new file mode 100644 index 00000000000..4d1dda97751 --- /dev/null +++ b/tests/ui/macros/paren-or-brace-expected.stderr @@ -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 +