about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbohan <bohan-zhang@foxmail.com>2023-11-26 22:05:13 +0800
committerbohan <bohan-zhang@foxmail.com>2023-12-06 23:19:39 +0800
commit0f14e8ea7421c791690e81e6a484eed81be7e7e1 (patch)
tree8a5523f630e5318e1ff6771bdd7d8a8cb4680ef0 /tests
parentdd6126ef5625299870f5fec4d14a605acddc81eb (diff)
downloadrust-0f14e8ea7421c791690e81e6a484eed81be7e7e1.tar.gz
rust-0f14e8ea7421c791690e81e6a484eed81be7e7e1.zip
tip for define macro name after `macro_rules!`
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/resolve/issue-118295.rs5
-rw-r--r--tests/ui/resolve/issue-118295.stderr14
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/resolve/issue-118295.rs b/tests/ui/resolve/issue-118295.rs
new file mode 100644
index 00000000000..b97681d9563
--- /dev/null
+++ b/tests/ui/resolve/issue-118295.rs
@@ -0,0 +1,5 @@
+macro_rules! {}
+//~^ ERROR cannot find macro `macro_rules` in this scope
+//~| NOTE maybe you have forgotten to define a name for this `macro_rules!`
+
+fn main() {}
diff --git a/tests/ui/resolve/issue-118295.stderr b/tests/ui/resolve/issue-118295.stderr
new file mode 100644
index 00000000000..d60d7d9185d
--- /dev/null
+++ b/tests/ui/resolve/issue-118295.stderr
@@ -0,0 +1,14 @@
+error: cannot find macro `macro_rules` in this scope
+  --> $DIR/issue-118295.rs:1:1
+   |
+LL | macro_rules! {}
+   | ^^^^^^^^^^^
+   |
+note: maybe you have forgotten to define a name for this `macro_rules!`
+  --> $DIR/issue-118295.rs:1:1
+   |
+LL | macro_rules! {}
+   | ^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+