about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/macros/paren-or-brace-expected.rs9
-rw-r--r--tests/ui/macros/paren-or-brace-expected.stderr14
2 files changed, 23 insertions, 0 deletions
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
+