Skip to content

Commit 54f3ddb

Browse files
committed
Call LateLintPass::check_attribute from with_lint_attrs
1 parent 0f74faf commit 54f3ddb

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

tests/ui/allow_attributes.fixed

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ struct T4;
2222
#[cfg_attr(panic = "unwind", expect(dead_code))]
2323
struct CfgT;
2424

25+
#[allow(clippy::allow_attributes, unused)]
26+
struct Allowed;
27+
28+
#[expect(clippy::allow_attributes)]
29+
#[allow(unused)]
30+
struct Expected;
31+
2532
fn ignore_external() {
2633
external! {
2734
#[allow(clippy::needless_borrow)] // Should not lint

tests/ui/allow_attributes.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ struct T4;
2222
#[cfg_attr(panic = "unwind", allow(dead_code))]
2323
struct CfgT;
2424

25+
#[allow(clippy::allow_attributes, unused)]
26+
struct Allowed;
27+
28+
#[expect(clippy::allow_attributes)]
29+
#[allow(unused)]
30+
struct Expected;
31+
2532
fn ignore_external() {
2633
external! {
2734
#[allow(clippy::needless_borrow)] // Should not lint

tests/ui/blanket_clippy_restriction_lints.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
error: `clippy::restriction` is not meant to be enabled as a group
2-
|
3-
= note: because of the command line `--warn clippy::restriction`
4-
= help: enable the restriction lints you need individually
5-
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
6-
= help: to override `-D warnings` add `#[allow(clippy::blanket_clippy_restriction_lints)]`
7-
81
error: `clippy::restriction` is not meant to be enabled as a group
92
--> $DIR/blanket_clippy_restriction_lints.rs:6:9
103
|
114
LL | #![warn(clippy::restriction)]
125
| ^^^^^^^^^^^^^^^^^^^
136
|
147
= help: enable the restriction lints you need individually
8+
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::blanket_clippy_restriction_lints)]`
1510

1611
error: `clippy::restriction` is not meant to be enabled as a group
1712
--> $DIR/blanket_clippy_restriction_lints.rs:8:9
@@ -29,5 +24,10 @@ LL | #![forbid(clippy::restriction)]
2924
|
3025
= help: enable the restriction lints you need individually
3126

27+
error: `clippy::restriction` is not meant to be enabled as a group
28+
|
29+
= note: because of the command line `--warn clippy::restriction`
30+
= help: enable the restriction lints you need individually
31+
3232
error: aborting due to 4 previous errors
3333

0 commit comments

Comments
 (0)