about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-09 00:55:49 +0000
committerbors <bors@rust-lang.org>2021-12-09 00:55:49 +0000
commit3c857f48ce12d1f98f3ea6d48eb9e33d8d60c985 (patch)
tree5db0b310af238377cfbde5bdd3ac75aad19dbb06 /src/test/ui/parser
parente6b883c74f49f32cb5d1cbad3457f2b8805a4a38 (diff)
parent40c6606b789122f1584a4e06556b858d543bef6b (diff)
downloadrust-3c857f48ce12d1f98f3ea6d48eb9e33d8d60c985.tar.gz
rust-3c857f48ce12d1f98f3ea6d48eb9e33d8d60c985.zip
Auto merge of #91677 - matthiaskrgr:rollup-yiczced, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #91245 (suggest casting between i/u32 and char)
 - #91337 (Add a suggestion if `macro_rules` is misspelled)
 - #91534 (Make rustdoc headings black, and markdown blue)
 - #91637 (Add test for packed drops in generators)
 - #91667 (Fix indent of itemTypes in search.js)

Failed merges:

 - #91568 (Pretty print break and continue without redundant space)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/misspelled-macro-rules.fixed13
-rw-r--r--src/test/ui/parser/misspelled-macro-rules.rs13
-rw-r--r--src/test/ui/parser/misspelled-macro-rules.stderr10
3 files changed, 36 insertions, 0 deletions
diff --git a/src/test/ui/parser/misspelled-macro-rules.fixed b/src/test/ui/parser/misspelled-macro-rules.fixed
new file mode 100644
index 00000000000..62be913d85f
--- /dev/null
+++ b/src/test/ui/parser/misspelled-macro-rules.fixed
@@ -0,0 +1,13 @@
+// Regression test for issue #91227.
+
+// run-rustfix
+
+#![allow(unused_macros)]
+
+macro_rules! thing {
+//~^ ERROR: expected one of
+//~| HELP: perhaps you meant to define a macro
+    () => {}
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/misspelled-macro-rules.rs b/src/test/ui/parser/misspelled-macro-rules.rs
new file mode 100644
index 00000000000..4290e6e5e4c
--- /dev/null
+++ b/src/test/ui/parser/misspelled-macro-rules.rs
@@ -0,0 +1,13 @@
+// Regression test for issue #91227.
+
+// run-rustfix
+
+#![allow(unused_macros)]
+
+marco_rules! thing {
+//~^ ERROR: expected one of
+//~| HELP: perhaps you meant to define a macro
+    () => {}
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/misspelled-macro-rules.stderr b/src/test/ui/parser/misspelled-macro-rules.stderr
new file mode 100644
index 00000000000..56df7123819
--- /dev/null
+++ b/src/test/ui/parser/misspelled-macro-rules.stderr
@@ -0,0 +1,10 @@
+error: expected one of `(`, `[`, or `{`, found `thing`
+  --> $DIR/misspelled-macro-rules.rs:7:14
+   |
+LL | marco_rules! thing {
+   | -----------  ^^^^^ expected one of `(`, `[`, or `{`
+   | |
+   | help: perhaps you meant to define a macro: `macro_rules`
+
+error: aborting due to previous error
+