about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuanqun Lu <guanqun.lu@gmail.com>2019-11-10 15:38:09 +0800
committerGuanqun Lu <guanqun.lu@gmail.com>2019-11-11 22:21:16 +0800
commit292ba98cb723fe2ab6ddcac9e4852be960deaaaa (patch)
tree8d6f916b003df4696ee2cc66c188c2b45cff9bb3 /src/test
parent1062b698c1faa66f7d53078cbb9ef2a493dc2ab7 (diff)
fix an ICE in macro's diagnostic message
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/parser/macros-no-semicolon-items.stderr6
-rw-r--r--src/test/ui/parser/mbe_missing_right_paren.rs3
-rw-r--r--src/test/ui/parser/mbe_missing_right_paren.stderr31
3 files changed, 37 insertions, 3 deletions
diff --git a/src/test/ui/parser/macros-no-semicolon-items.stderr b/src/test/ui/parser/macros-no-semicolon-items.stderr
index 980ceeed8c6..f9019b78c8d 100644
--- a/src/test/ui/parser/macros-no-semicolon-items.stderr
+++ b/src/test/ui/parser/macros-no-semicolon-items.stderr
@@ -6,8 +6,8 @@ LL | macro_rules! foo()
    |
 help: change the delimiters to curly braces
    |
-LL | macro_rules! foo {}
-   |                  ^^
+LL | macro_rules! foo{}
+   |                 ^^
 help: add a semicolon
    |
 LL | macro_rules! foo();
@@ -26,7 +26,7 @@ LL | | )
    |
 help: change the delimiters to curly braces
    |
-LL | bar! {
+LL | bar!{
 LL |     blah
 LL |     blah
 LL |     blah
diff --git a/src/test/ui/parser/mbe_missing_right_paren.rs b/src/test/ui/parser/mbe_missing_right_paren.rs
new file mode 100644
index 00000000000..689176b3eb7
--- /dev/null
+++ b/src/test/ui/parser/mbe_missing_right_paren.rs
@@ -0,0 +1,3 @@
+// ignore-tidy-trailing-newlines
+// error-pattern: aborting due to 3 previous errors
+macro_rules! abc(ؼ
\ No newline at end of file
diff --git a/src/test/ui/parser/mbe_missing_right_paren.stderr b/src/test/ui/parser/mbe_missing_right_paren.stderr
new file mode 100644
index 00000000000..4504fc0eb00
--- /dev/null
+++ b/src/test/ui/parser/mbe_missing_right_paren.stderr
@@ -0,0 +1,31 @@
+error: this file contains an un-closed delimiter
+  --> $DIR/mbe_missing_right_paren.rs:3:19
+   |
+LL | macro_rules! abc(ؼ
+   |                 - ^
+   |                 |
+   |                 un-closed delimiter
+
+error: macros that expand to items must be delimited with braces or followed by a semicolon
+  --> $DIR/mbe_missing_right_paren.rs:3:17
+   |
+LL | macro_rules! abc(ؼ
+   |                 ^^
+   |
+help: change the delimiters to curly braces
+   |
+LL | macro_rules! abc{ؼ}
+   |                 ^ ^
+help: add a semicolon
+   |
+LL | macro_rules! abc(ؼ;
+   |                   ^
+
+error: unexpected end of macro invocation
+  --> $DIR/mbe_missing_right_paren.rs:3:1
+   |
+LL | macro_rules! abc(ؼ
+   | ^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments
+
+error: aborting due to 3 previous errors
+