about summary refs log tree commit diff
path: root/tests/ui/resolve
diff options
context:
space:
mode:
authorLin Yihai <linyihai@huawei.com>2024-07-10 10:59:33 +0800
committerLin Yihai <linyihai@huawei.com>2024-07-26 10:51:55 +0800
commit2fca4ea317f2f45a9a6f8272e52661807b100ca3 (patch)
tree9aaa1348a58fb8a6863ccf6d52ccd4bba1f9015d /tests/ui/resolve
parent5be2ec7245de6e8015a0daedf24d20e3e5bf2062 (diff)
downloadrust-2fca4ea317f2f45a9a6f8272e52661807b100ca3.tar.gz
rust-2fca4ea317f2f45a9a6f8272e52661807b100ca3.zip
Add a label to point to the lacking macro name definition
Diffstat (limited to 'tests/ui/resolve')
-rw-r--r--tests/ui/resolve/issue-118295.rs6
-rw-r--r--tests/ui/resolve/issue-118295.stderr18
2 files changed, 21 insertions, 3 deletions
diff --git a/tests/ui/resolve/issue-118295.rs b/tests/ui/resolve/issue-118295.rs
index b97681d9563..37a49baee80 100644
--- a/tests/ui/resolve/issue-118295.rs
+++ b/tests/ui/resolve/issue-118295.rs
@@ -1,5 +1,11 @@
 macro_rules! {}
 //~^ ERROR cannot find macro `macro_rules` in this scope
 //~| NOTE maybe you have forgotten to define a name for this `macro_rules!`
+//~| put a macro name here
+
+macro_rules!{}
+//~^ ERROR cannot find macro `macro_rules` in this scope
+//~| NOTE maybe you have forgotten to define a name for this `macro_rules!`
+//~| put a macro name here
 
 fn main() {}
diff --git a/tests/ui/resolve/issue-118295.stderr b/tests/ui/resolve/issue-118295.stderr
index d60d7d9185d..06a37e81d6c 100644
--- a/tests/ui/resolve/issue-118295.stderr
+++ b/tests/ui/resolve/issue-118295.stderr
@@ -1,14 +1,26 @@
 error: cannot find macro `macro_rules` in this scope
-  --> $DIR/issue-118295.rs:1:1
+  --> $DIR/issue-118295.rs:6:1
    |
-LL | macro_rules! {}
+LL | macro_rules!{}
    | ^^^^^^^^^^^
    |
 note: maybe you have forgotten to define a name for this `macro_rules!`
+  --> $DIR/issue-118295.rs:6:12
+   |
+LL | macro_rules!{}
+   |            ^ put a macro name here
+
+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:12
+   |
+LL | macro_rules! {}
+   |            ^ put a macro name here
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors