forked from rust-lang/rust-clippy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ui test for
unneeded_clippy_cfg_attr
- Loading branch information
1 parent
f35d87f
commit cf6a14c
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//@no-rustfix | ||
|
||
#![warn(clippy::unnecessary_clippy_cfg)] | ||
#![cfg_attr(clippy, deny(clippy::non_minimal_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
#![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
#![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
#![cfg_attr(clippy, deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
|
||
#[cfg_attr(clippy, deny(clippy::non_minimal_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
#[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
#[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
#[cfg_attr(clippy, deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
//~^ ERROR: no need to put clippy lints behind a `clippy` cfg | ||
pub struct Bar; | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:13:1 | ||
| | ||
LL | #[cfg_attr(clippy, deny(clippy::non_minimal_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `#[deny(clippy::non_minimal_cfg)]` | ||
| | ||
= note: `-D clippy::unnecessary-clippy-cfg` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_clippy_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:15:36 | ||
| | ||
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: write instead: `#[deny(clippy::non_minimal_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:17:36 | ||
| | ||
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: write instead: `#[deny(clippy::non_minimal_cfg,clippy::maybe_misused_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:19:1 | ||
| | ||
LL | #[cfg_attr(clippy, deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `#[deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:4:1 | ||
| | ||
LL | #![cfg_attr(clippy, deny(clippy::non_minimal_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `#![deny(clippy::non_minimal_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:6:37 | ||
| | ||
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: write instead: `#![deny(clippy::non_minimal_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:8:37 | ||
| | ||
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: write instead: `#![deny(clippy::non_minimal_cfg,clippy::maybe_misused_cfg)]` | ||
|
||
error: no need to put clippy lints behind a `clippy` cfg | ||
--> tests/ui/unnecessary_clippy_cfg.rs:10:1 | ||
| | ||
LL | #![cfg_attr(clippy, deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg))] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `#![deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg)]` | ||
|
||
error: aborting due to 8 previous errors | ||
|