about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-04-09 21:15:45 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-04-17 09:50:52 +1000
commit400e8e5dc819b1fa7f994fb60dbe8b5112ec3fd2 (patch)
treede93c7a1439a8869c653ed6df06c41e3025092c1 /tests
parent4be670f89b94aaeab04b0e52d0efd9c61f1bef9d (diff)
downloadrust-400e8e5dc819b1fa7f994fb60dbe8b5112ec3fd2.tar.gz
rust-400e8e5dc819b1fa7f994fb60dbe8b5112ec3fd2.zip
Fix attribute printing in an error.
The current code assumes that the attribute is just an identifier, and
so misprints paths.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/attributes/check-builtin-attr-ice.rs4
-rw-r--r--tests/ui/attributes/check-builtin-attr-ice.stderr4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/attributes/check-builtin-attr-ice.rs b/tests/ui/attributes/check-builtin-attr-ice.rs
index e3a2ffc714d..7745849acd0 100644
--- a/tests/ui/attributes/check-builtin-attr-ice.rs
+++ b/tests/ui/attributes/check-builtin-attr-ice.rs
@@ -44,12 +44,12 @@
 struct Foo {
     #[should_panic::skip]
     //~^ ERROR failed to resolve
-    //~| ERROR `#[]` only has an effect on functions
+    //~| ERROR `#[should_panic::skip]` only has an effect on functions
     pub field: u8,
 
     #[should_panic::a::b::c]
     //~^ ERROR failed to resolve
-    //~| ERROR `#[]` only has an effect on functions
+    //~| ERROR `#[should_panic::a::b::c]` only has an effect on functions
     pub field2: u8,
 }
 
diff --git a/tests/ui/attributes/check-builtin-attr-ice.stderr b/tests/ui/attributes/check-builtin-attr-ice.stderr
index 487a0b6d680..4f26f71efb7 100644
--- a/tests/ui/attributes/check-builtin-attr-ice.stderr
+++ b/tests/ui/attributes/check-builtin-attr-ice.stderr
@@ -16,7 +16,7 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `den
 LL |     #[deny::skip]
    |       ^^^^ use of unresolved module or unlinked crate `deny`
 
-error: `#[]` only has an effect on functions
+error: `#[should_panic::skip]` only has an effect on functions
   --> $DIR/check-builtin-attr-ice.rs:45:5
    |
 LL |     #[should_panic::skip]
@@ -28,7 +28,7 @@ note: the lint level is defined here
 LL | #![deny(unused_attributes)]
    |         ^^^^^^^^^^^^^^^^^
 
-error: `#[]` only has an effect on functions
+error: `#[should_panic::a::b::c]` only has an effect on functions
   --> $DIR/check-builtin-attr-ice.rs:50:5
    |
 LL |     #[should_panic::a::b::c]