Skip to content

Commit ce0ffbf

Browse files
committed
Attributes cleanup in tests
- Remove `allow` attributes for lints covered by the `unused` group in UI tests - Replace `allow` with `expect` for lints that fire, remove those that don't - Reorder attribute names inside allow or expect inner attributes
1 parent 8a61907 commit ce0ffbf

1,645 files changed

Lines changed: 7578 additions & 9229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
#![allow(dead_code)]
21
#![deny(clippy::multiple_inherent_impl)]
32
fn main() {}

tests/ui-cargo/multiple_inherent_impl/crate_fail/Cargo.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ note: first implementation here
1515
9 | | }
1616
| |_^
1717
note: the lint level is defined here
18-
--> src/main.rs:2:9
18+
--> src/main.rs:1:9
1919
|
20-
2 | #![deny(clippy::multiple_inherent_impl)]
20+
1 | #![deny(clippy::multiple_inherent_impl)]
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222

2323
error: multiple implementations of this structure

tests/ui-cargo/multiple_inherent_impl/crate_fail/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![allow(dead_code)]
21
#![deny(clippy::multiple_inherent_impl)]
2+
#![allow(dead_code)]
33

44
struct S;
55
struct T;

tests/ui-cargo/multiple_inherent_impl/file_fail/Cargo.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ note: first implementation here
1515
8 | | }
1616
| |_^
1717
note: the lint level is defined here
18-
--> src/main.rs:2:9
18+
--> src/main.rs:1:9
1919
|
20-
2 | #![deny(clippy::multiple_inherent_impl)]
20+
1 | #![deny(clippy::multiple_inherent_impl)]
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222

2323
error: multiple implementations of this structure

tests/ui-cargo/multiple_inherent_impl/file_fail/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![allow(dead_code)]
21
#![deny(clippy::multiple_inherent_impl)]
2+
#![allow(dead_code)]
33

44
struct S;
55

Lines changed: 108 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,119 @@
1+
error: struct `S` is never constructed
2+
--> src/main.rs:3:8
3+
|
4+
3 | struct S;
5+
| ^
6+
|
7+
= note: `-D dead-code` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[expect(dead_code)]` or `#[allow(dead_code)]`
9+
10+
error: associated function `first` is never used
11+
--> src/main.rs:6:8
12+
|
13+
5 | impl S {
14+
| ------ associated function in this implementation
15+
6 | fn first() {}
16+
| ^^^^^
17+
18+
error: associated function `second` is never used
19+
--> src/main.rs:36:8
20+
|
21+
34 | impl c::S {
22+
| --------- associated function in this implementation
23+
35 | //^ Must NOT trigger
24+
36 | fn second() {}
25+
| ^^^^^^
26+
27+
error: associated function `second` is never used
28+
--> src/main.rs:14:12
29+
|
30+
12 | impl S {
31+
| ------ associated function in this implementation
32+
13 | //^ Must NOT trigger
33+
14 | fn second() {}
34+
| ^^^^^^
35+
36+
error: struct `S` is never constructed
37+
--> src/main.rs:19:12
38+
|
39+
19 | struct S;
40+
| ^
41+
42+
error: associated function `first` is never used
43+
--> src/main.rs:22:12
44+
|
45+
21 | impl S {
46+
| ------ associated function in this implementation
47+
22 | fn first() {}
48+
| ^^^^^
49+
50+
error: associated function `second` is never used
51+
--> src/main.rs:28:12
52+
|
53+
25 | impl S {
54+
| ------ associated function in this implementation
55+
...
56+
28 | fn second() {}
57+
| ^^^^^^
58+
59+
error: struct `S` is never constructed
60+
--> src/c.rs:1:12
61+
|
62+
1 | pub struct S;
63+
| ^
64+
65+
error: struct `T` is never constructed
66+
--> src/c.rs:2:8
67+
|
68+
2 | struct T;
69+
| ^
70+
71+
error: associated function `first` is never used
72+
--> src/c.rs:5:8
73+
|
74+
4 | impl S {
75+
| ------ associated function in this implementation
76+
5 | fn first() {}
77+
| ^^^^^
78+
79+
error: associated function `first` is never used
80+
--> src/c.rs:9:8
81+
|
82+
8 | impl T {
83+
| ------ associated function in this implementation
84+
9 | fn first() {}
85+
| ^^^^^
86+
87+
error: associated function `second` is never used
88+
--> src/c.rs:14:8
89+
|
90+
12 | impl T {
91+
| ------ associated function in this implementation
92+
13 | //^ Must trigger
93+
14 | fn second() {}
94+
| ^^^^^^
95+
196
error: multiple implementations of this structure
2-
--> src/main.rs:26:5
97+
--> src/main.rs:25:5
398
|
4-
26 | / impl S {
5-
27 | | //^ Must trigger
6-
28 | |
7-
29 | | fn second() {}
8-
30 | | }
99+
25 | / impl S {
100+
26 | | //^ Must trigger
101+
27 | |
102+
28 | | fn second() {}
103+
29 | | }
9104
| |_____^
10105
|
11106
note: first implementation here
12-
--> src/main.rs:22:5
107+
--> src/main.rs:21:5
13108
|
14-
22 | / impl S {
15-
23 | | fn first() {}
16-
24 | | }
109+
21 | / impl S {
110+
22 | | fn first() {}
111+
23 | | }
17112
| |_____^
18113
note: the lint level is defined here
19-
--> src/main.rs:2:9
114+
--> src/main.rs:1:9
20115
|
21-
2 | #![deny(clippy::multiple_inherent_impl)]
116+
1 | #![deny(clippy::multiple_inherent_impl)]
22117
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23118

24119
error: multiple implementations of this structure
@@ -38,4 +133,4 @@ note: first implementation here
38133
10 | | }
39134
| |_^
40135

41-
error: could not compile `module_fail` (bin "module_fail") due to 2 previous errors
136+
error: could not compile `module_fail` (bin "module_fail") due to 14 previous errors

tests/ui-cargo/multiple_inherent_impl/module_fail/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(dead_code)]
21
#![deny(clippy::multiple_inherent_impl)]
32

43
struct S;

tests/ui-toml/arbitrary_source_item_ordering/ordering_good.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
//@[bad_conf_6] error-in-other-file:
1919
//@compile-flags: --test
2020

21-
#![allow(dead_code)]
2221
#![warn(clippy::arbitrary_source_item_ordering)]
2322

2423
/// This module gets linted before clippy gives up.

tests/ui-toml/arbitrary_source_item_ordering/ordering_good_var_1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//@[var_1] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/arbitrary_source_item_ordering/var_1
44
//@check-pass
55

6-
#![allow(dead_code)]
76
#![warn(clippy::arbitrary_source_item_ordering)]
87

98
/// This module gets linted before clippy gives up.

0 commit comments

Comments
 (0)