Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 9, 2024
1 parent 74dcc70 commit 95e77bc
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 22 deletions.
2 changes: 1 addition & 1 deletion tests/ui/duplicated_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn foo() {}

#[cfg(unix)]
#[cfg(windows)]
#[cfg(unix)] //~ ERROR: duplicated attribute
#[cfg(unix)] // cfgs are not handled
fn bar() {}

#[proc_macro_attr::duplicated_attr()] // Should not warn!
Expand Down
19 changes: 1 addition & 18 deletions tests/ui/duplicated_attributes.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,5 @@ help: remove this attribute
LL | #[allow(dead_code)]
| ^^^^^^^^^

error: duplicated attribute
--> tests/ui/duplicated_attributes.rs:20:7
|
LL | #[cfg(unix)]
| ^^^^
|
note: first defined here
--> tests/ui/duplicated_attributes.rs:18:7
|
LL | #[cfg(unix)]
| ^^^^
help: remove this attribute
--> tests/ui/duplicated_attributes.rs:20:7
|
LL | #[cfg(unix)]
| ^^^^

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

38 changes: 37 additions & 1 deletion tests/ui/unnecessary_clippy_cfg.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,41 @@ error: no need to put clippy lints behind a `clippy` cfg
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
error: duplicated attribute
--> tests/ui/unnecessary_clippy_cfg.rs:8:26
|
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
| ^^^^^^^^^
|
note: first defined here
--> tests/ui/unnecessary_clippy_cfg.rs:6:26
|
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))]
| ^^^^^^^^^
help: remove this attribute
--> tests/ui/unnecessary_clippy_cfg.rs:8:26
|
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
| ^^^^^^^^^
= note: `-D clippy::duplicated-attributes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::duplicated_attributes)]`

error: duplicated attribute
--> tests/ui/unnecessary_clippy_cfg.rs:17:25
|
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
| ^^^^^^^^^
|
note: first defined here
--> tests/ui/unnecessary_clippy_cfg.rs:15:25
|
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))]
| ^^^^^^^^^
help: remove this attribute
--> tests/ui/unnecessary_clippy_cfg.rs:17:25
|
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
| ^^^^^^^^^

error: aborting due to 10 previous errors

2 changes: 1 addition & 1 deletion tests/ui/useless_attribute.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@aux-build:proc_macro_derive.rs

#![allow(unused)]
#![allow(unused, clippy::duplicated_attributes)]
#![warn(clippy::useless_attribute)]
#![warn(unreachable_pub)]
#![feature(rustc_private)]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/useless_attribute.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@aux-build:proc_macro_derive.rs

#![allow(unused)]
#![allow(unused, clippy::duplicated_attributes)]
#![warn(clippy::useless_attribute)]
#![warn(unreachable_pub)]
#![feature(rustc_private)]
Expand Down

0 comments on commit 95e77bc

Please sign in to comment.