diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-09-16 11:52:17 -0700 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-09-27 19:32:14 +0200 |
| commit | b3631e1174e222bf1dadf1549cfd0f717ebf6d64 (patch) | |
| tree | 10ca9f88ec5f1224947544cfd2d5ca76d09e13d1 /tests/ui | |
| parent | ade84871f718ea20a6460d28e82290353b4bf3d2 (diff) | |
| download | rust-b3631e1174e222bf1dadf1549cfd0f717ebf6d64.tar.gz rust-b3631e1174e222bf1dadf1549cfd0f717ebf6d64.zip | |
improve empty attribute diagnostic
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/attributes/empty-repr.stderr | 1 | ||||
| -rw-r--r-- | tests/ui/empty/empty-attributes.stderr | 4 | ||||
| -rw-r--r-- | tests/ui/macros/macro-use-all-and-none.stderr | 3 | ||||
| -rw-r--r-- | tests/ui/repr/repr-empty-packed.stderr | 1 |
4 files changed, 8 insertions, 1 deletions
diff --git a/tests/ui/attributes/empty-repr.stderr b/tests/ui/attributes/empty-repr.stderr index 92901fa170c..6dfa2df75b7 100644 --- a/tests/ui/attributes/empty-repr.stderr +++ b/tests/ui/attributes/empty-repr.stderr @@ -4,6 +4,7 @@ error: unused attribute LL | #[repr()] | ^^^^^^^^^ help: remove this attribute | + = note: using `repr` with an empty list has no effect note: the lint level is defined here --> $DIR/empty-repr.rs:4:9 | diff --git a/tests/ui/empty/empty-attributes.stderr b/tests/ui/empty/empty-attributes.stderr index f0be56ddc6a..41dc790737d 100644 --- a/tests/ui/empty/empty-attributes.stderr +++ b/tests/ui/empty/empty-attributes.stderr @@ -56,12 +56,16 @@ error: unused attribute | LL | #[repr()] | ^^^^^^^^^ help: remove this attribute + | + = note: using `repr` with an empty list has no effect error: unused attribute --> $DIR/empty-attributes.rs:12:1 | LL | #[target_feature()] | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute + | + = note: using `target_feature` with an empty list has no effect error: aborting due to 8 previous errors diff --git a/tests/ui/macros/macro-use-all-and-none.stderr b/tests/ui/macros/macro-use-all-and-none.stderr index a5efb065a21..b4c05adcb33 100644 --- a/tests/ui/macros/macro-use-all-and-none.stderr +++ b/tests/ui/macros/macro-use-all-and-none.stderr @@ -2,8 +2,9 @@ warning: unused attribute --> $DIR/macro-use-all-and-none.rs:7:12 | LL | #[macro_use()] - | ^^ help: remove this attribute + | ^^ help: remove these parentheses | + = note: using `macro_use` with an empty list is equivalent to not using a list at all note: the lint level is defined here --> $DIR/macro-use-all-and-none.rs:4:9 | diff --git a/tests/ui/repr/repr-empty-packed.stderr b/tests/ui/repr/repr-empty-packed.stderr index 6565b2e8c1d..adf32c95529 100644 --- a/tests/ui/repr/repr-empty-packed.stderr +++ b/tests/ui/repr/repr-empty-packed.stderr @@ -15,6 +15,7 @@ error: unused attribute LL | #[repr()] | ^^^^^^^^^ help: remove this attribute | + = note: using `repr` with an empty list has no effect note: the lint level is defined here --> $DIR/repr-empty-packed.rs:2:9 | |
