Skip to content

Commit 95e77bc

Browse files
Update tests
1 parent 74dcc70 commit 95e77bc

File tree

5 files changed

+41
-22
lines changed

5 files changed

+41
-22
lines changed

tests/ui/duplicated_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn foo() {}
1717

1818
#[cfg(unix)]
1919
#[cfg(windows)]
20-
#[cfg(unix)] //~ ERROR: duplicated attribute
20+
#[cfg(unix)] // cfgs are not handled
2121
fn bar() {}
2222

2323
#[proc_macro_attr::duplicated_attr()] // Should not warn!

tests/ui/duplicated_attributes.stderr

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,5 @@ help: remove this attribute
3434
LL | #[allow(dead_code)]
3535
| ^^^^^^^^^
3636

37-
error: duplicated attribute
38-
--> tests/ui/duplicated_attributes.rs:20:7
39-
|
40-
LL | #[cfg(unix)]
41-
| ^^^^
42-
|
43-
note: first defined here
44-
--> tests/ui/duplicated_attributes.rs:18:7
45-
|
46-
LL | #[cfg(unix)]
47-
| ^^^^
48-
help: remove this attribute
49-
--> tests/ui/duplicated_attributes.rs:20:7
50-
|
51-
LL | #[cfg(unix)]
52-
| ^^^^
53-
54-
error: aborting due to 3 previous errors
37+
error: aborting due to 2 previous errors
5538

tests/ui/unnecessary_clippy_cfg.stderr

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,41 @@ error: no need to put clippy lints behind a `clippy` cfg
5757
LL | #![cfg_attr(clippy, deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `#![deny(clippy::non_minimal_cfg, clippy::maybe_misused_cfg)]`
5959

60-
error: aborting due to 8 previous errors
60+
error: duplicated attribute
61+
--> tests/ui/unnecessary_clippy_cfg.rs:8:26
62+
|
63+
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
64+
| ^^^^^^^^^
65+
|
66+
note: first defined here
67+
--> tests/ui/unnecessary_clippy_cfg.rs:6:26
68+
|
69+
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))]
70+
| ^^^^^^^^^
71+
help: remove this attribute
72+
--> tests/ui/unnecessary_clippy_cfg.rs:8:26
73+
|
74+
LL | #![cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
75+
| ^^^^^^^^^
76+
= note: `-D clippy::duplicated-attributes` implied by `-D warnings`
77+
= help: to override `-D warnings` add `#[allow(clippy::duplicated_attributes)]`
78+
79+
error: duplicated attribute
80+
--> tests/ui/unnecessary_clippy_cfg.rs:17:25
81+
|
82+
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
83+
| ^^^^^^^^^
84+
|
85+
note: first defined here
86+
--> tests/ui/unnecessary_clippy_cfg.rs:15:25
87+
|
88+
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg))]
89+
| ^^^^^^^^^
90+
help: remove this attribute
91+
--> tests/ui/unnecessary_clippy_cfg.rs:17:25
92+
|
93+
LL | #[cfg_attr(clippy, deny(dead_code, clippy::non_minimal_cfg, clippy::maybe_misused_cfg))]
94+
| ^^^^^^^^^
95+
96+
error: aborting due to 10 previous errors
6197

tests/ui/useless_attribute.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@aux-build:proc_macro_derive.rs
22

3-
#![allow(unused)]
3+
#![allow(unused, clippy::duplicated_attributes)]
44
#![warn(clippy::useless_attribute)]
55
#![warn(unreachable_pub)]
66
#![feature(rustc_private)]

tests/ui/useless_attribute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@aux-build:proc_macro_derive.rs
22

3-
#![allow(unused)]
3+
#![allow(unused, clippy::duplicated_attributes)]
44
#![warn(clippy::useless_attribute)]
55
#![warn(unreachable_pub)]
66
#![feature(rustc_private)]

0 commit comments

Comments
 (0)