Skip to content

Commit 368ead0

Browse files
committed
Attributes cleanup in tests [14/20]
1 parent fdd9f4e commit 368ead0

85 files changed

Lines changed: 376 additions & 448 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.

tests/ui/non_minimal_cfg2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@require-annotations-for-level: WARN
2-
#![allow(unused)]
32

43
#[cfg(all())]
54
//~^ ERROR: unneeded sub `cfg` when there is no condition

tests/ui/non_minimal_cfg2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unneeded sub `cfg` when there is no condition
2-
--> tests/ui/non_minimal_cfg2.rs:4:7
2+
--> tests/ui/non_minimal_cfg2.rs:3:7
33
|
44
LL | #[cfg(all())]
55
| ^^^^^

tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@aux-build:lazy_static.rs
33

44
#![warn(clippy::non_std_lazy_statics)]
5-
#![allow(static_mut_refs)]
5+
#![expect(static_mut_refs)]
66

77
use once_cell::sync::Lazy;
88

tests/ui/non_std_lazy_static/non_std_lazy_static_fixable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@aux-build:lazy_static.rs
33

44
#![warn(clippy::non_std_lazy_statics)]
5-
#![allow(static_mut_refs)]
5+
#![expect(static_mut_refs)]
66

77
use once_cell::sync::Lazy;
88

tests/ui/non_std_lazy_static/non_std_lazy_static_unfixable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@no-rustfix
44

55
#![warn(clippy::non_std_lazy_statics)]
6-
#![allow(static_mut_refs)]
6+
#![expect(static_mut_refs)]
77

88
mod once_cell_lazy {
99
use once_cell::sync::Lazy;

tests/ui/nonminimal_bool.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//@no-rustfix: overlapping suggestions
2-
#![allow(
3-
unused,
2+
#![warn(clippy::nonminimal_bool)]
3+
#![expect(
44
clippy::diverging_sub_expression,
55
clippy::needless_ifs,
66
clippy::redundant_pattern_matching
77
)]
8-
#![warn(clippy::nonminimal_bool)]
98
#![allow(clippy::useless_vec)]
109

1110
fn main() {

tests/ui/nonminimal_bool.stderr

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this boolean expression can be simplified
2-
--> tests/ui/nonminimal_bool.rs:17:13
2+
--> tests/ui/nonminimal_bool.rs:16:13
33
|
44
LL | let _ = !true;
55
| ^^^^^
@@ -13,7 +13,7 @@ LL + let _ = false;
1313
|
1414

1515
error: this boolean expression can be simplified
16-
--> tests/ui/nonminimal_bool.rs:20:13
16+
--> tests/ui/nonminimal_bool.rs:19:13
1717
|
1818
LL | let _ = !false;
1919
| ^^^^^^
@@ -25,7 +25,7 @@ LL + let _ = true;
2525
|
2626

2727
error: this boolean expression can be simplified
28-
--> tests/ui/nonminimal_bool.rs:23:13
28+
--> tests/ui/nonminimal_bool.rs:22:13
2929
|
3030
LL | let _ = !!a;
3131
| ^^^
@@ -37,7 +37,7 @@ LL + let _ = a;
3737
|
3838

3939
error: this boolean expression can be simplified
40-
--> tests/ui/nonminimal_bool.rs:26:13
40+
--> tests/ui/nonminimal_bool.rs:25:13
4141
|
4242
LL | let _ = false || a;
4343
| ^^^^^^^^^^
@@ -49,7 +49,7 @@ LL + let _ = a;
4949
|
5050

5151
error: this boolean expression can be simplified
52-
--> tests/ui/nonminimal_bool.rs:32:13
52+
--> tests/ui/nonminimal_bool.rs:31:13
5353
|
5454
LL | let _ = !(!a && b);
5555
| ^^^^^^^^^^
@@ -61,7 +61,7 @@ LL + let _ = a || !b;
6161
|
6262

6363
error: this boolean expression can be simplified
64-
--> tests/ui/nonminimal_bool.rs:35:13
64+
--> tests/ui/nonminimal_bool.rs:34:13
6565
|
6666
LL | let _ = !(!a || b);
6767
| ^^^^^^^^^^
@@ -73,7 +73,7 @@ LL + let _ = a && !b;
7373
|
7474

7575
error: this boolean expression can be simplified
76-
--> tests/ui/nonminimal_bool.rs:38:13
76+
--> tests/ui/nonminimal_bool.rs:37:13
7777
|
7878
LL | let _ = !a && !(b && c);
7979
| ^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL + let _ = !(a || b && c);
8585
|
8686

8787
error: this boolean expression can be simplified
88-
--> tests/ui/nonminimal_bool.rs:47:13
88+
--> tests/ui/nonminimal_bool.rs:46:13
8989
|
9090
LL | let _ = a == b && c == 5 && a == b;
9191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,7 +100,7 @@ LL + let _ = a == b && c == 5;
100100
|
101101

102102
error: this boolean expression can be simplified
103-
--> tests/ui/nonminimal_bool.rs:50:13
103+
--> tests/ui/nonminimal_bool.rs:49:13
104104
|
105105
LL | let _ = a == b || c == 5 || a == b;
106106
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -115,7 +115,7 @@ LL + let _ = a == b || c == 5;
115115
|
116116

117117
error: this boolean expression can be simplified
118-
--> tests/ui/nonminimal_bool.rs:53:13
118+
--> tests/ui/nonminimal_bool.rs:52:13
119119
|
120120
LL | let _ = a == b && c == 5 && b == a;
121121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -130,7 +130,7 @@ LL + let _ = a == b && c == 5;
130130
|
131131

132132
error: this boolean expression can be simplified
133-
--> tests/ui/nonminimal_bool.rs:56:13
133+
--> tests/ui/nonminimal_bool.rs:55:13
134134
|
135135
LL | let _ = a != b || !(a != b || c == d);
136136
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -145,7 +145,7 @@ LL + let _ = a != b || c != d;
145145
|
146146

147147
error: this boolean expression can be simplified
148-
--> tests/ui/nonminimal_bool.rs:59:13
148+
--> tests/ui/nonminimal_bool.rs:58:13
149149
|
150150
LL | let _ = a != b && !(a != b && c == d);
151151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -160,7 +160,7 @@ LL + let _ = a != b && c != d;
160160
|
161161

162162
error: this boolean expression can be simplified
163-
--> tests/ui/nonminimal_bool.rs:90:8
163+
--> tests/ui/nonminimal_bool.rs:89:8
164164
|
165165
LL | if matches!(true, true) && true {
166166
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -172,37 +172,37 @@ LL + if matches!(true, true) {
172172
|
173173

174174
error: this boolean expression can be simplified
175-
--> tests/ui/nonminimal_bool.rs:171:8
175+
--> tests/ui/nonminimal_bool.rs:170:8
176176
|
177177
LL | if !(12 == a) {}
178178
| ^^^^^^^^^^ help: try: `(12 != a)`
179179

180180
error: this boolean expression can be simplified
181-
--> tests/ui/nonminimal_bool.rs:173:8
181+
--> tests/ui/nonminimal_bool.rs:172:8
182182
|
183183
LL | if !(a == 12) {}
184184
| ^^^^^^^^^^ help: try: `(a != 12)`
185185

186186
error: this boolean expression can be simplified
187-
--> tests/ui/nonminimal_bool.rs:175:8
187+
--> tests/ui/nonminimal_bool.rs:174:8
188188
|
189189
LL | if !(12 != a) {}
190190
| ^^^^^^^^^^ help: try: `(12 == a)`
191191

192192
error: this boolean expression can be simplified
193-
--> tests/ui/nonminimal_bool.rs:177:8
193+
--> tests/ui/nonminimal_bool.rs:176:8
194194
|
195195
LL | if !(a != 12) {}
196196
| ^^^^^^^^^^ help: try: `(a == 12)`
197197

198198
error: this boolean expression can be simplified
199-
--> tests/ui/nonminimal_bool.rs:182:8
199+
--> tests/ui/nonminimal_bool.rs:181:8
200200
|
201201
LL | if !b == true {}
202202
| ^^^^^^^^^^ help: try: `b != true`
203203

204204
error: equality checks against true are unnecessary
205-
--> tests/ui/nonminimal_bool.rs:182:8
205+
--> tests/ui/nonminimal_bool.rs:181:8
206206
|
207207
LL | if !b == true {}
208208
| ^^^^^^^^^^ help: try: `!b`
@@ -211,55 +211,55 @@ LL | if !b == true {}
211211
= help: to override `-D warnings` add `#[allow(clippy::bool_comparison)]`
212212

213213
error: this boolean expression can be simplified
214-
--> tests/ui/nonminimal_bool.rs:185:8
214+
--> tests/ui/nonminimal_bool.rs:184:8
215215
|
216216
LL | if !b != true {}
217217
| ^^^^^^^^^^ help: try: `b == true`
218218

219219
error: inequality checks against true can be replaced by a negation
220-
--> tests/ui/nonminimal_bool.rs:185:8
220+
--> tests/ui/nonminimal_bool.rs:184:8
221221
|
222222
LL | if !b != true {}
223223
| ^^^^^^^^^^ help: try: `b`
224224

225225
error: this boolean expression can be simplified
226-
--> tests/ui/nonminimal_bool.rs:188:8
226+
--> tests/ui/nonminimal_bool.rs:187:8
227227
|
228228
LL | if true == !b {}
229229
| ^^^^^^^^^^ help: try: `true != b`
230230

231231
error: equality checks against true are unnecessary
232-
--> tests/ui/nonminimal_bool.rs:188:8
232+
--> tests/ui/nonminimal_bool.rs:187:8
233233
|
234234
LL | if true == !b {}
235235
| ^^^^^^^^^^ help: try: `!b`
236236

237237
error: this boolean expression can be simplified
238-
--> tests/ui/nonminimal_bool.rs:191:8
238+
--> tests/ui/nonminimal_bool.rs:190:8
239239
|
240240
LL | if true != !b {}
241241
| ^^^^^^^^^^ help: try: `true == b`
242242

243243
error: inequality checks against true can be replaced by a negation
244-
--> tests/ui/nonminimal_bool.rs:191:8
244+
--> tests/ui/nonminimal_bool.rs:190:8
245245
|
246246
LL | if true != !b {}
247247
| ^^^^^^^^^^ help: try: `b`
248248

249249
error: this boolean expression can be simplified
250-
--> tests/ui/nonminimal_bool.rs:194:8
250+
--> tests/ui/nonminimal_bool.rs:193:8
251251
|
252252
LL | if !b == !c {}
253253
| ^^^^^^^^ help: try: `b == c`
254254

255255
error: this boolean expression can be simplified
256-
--> tests/ui/nonminimal_bool.rs:196:8
256+
--> tests/ui/nonminimal_bool.rs:195:8
257257
|
258258
LL | if !b != !c {}
259259
| ^^^^^^^^ help: try: `b != c`
260260

261261
error: this boolean expression can be simplified
262-
--> tests/ui/nonminimal_bool.rs:212:8
262+
--> tests/ui/nonminimal_bool.rs:211:8
263263
|
264264
LL | if !(a < 2.0 && !b) {
265265
| ^^^^^^^^^^^^^^^^
@@ -271,7 +271,7 @@ LL + if a >= 2.0 || b {
271271
|
272272

273273
error: this boolean expression can be simplified
274-
--> tests/ui/nonminimal_bool.rs:231:12
274+
--> tests/ui/nonminimal_bool.rs:230:12
275275
|
276276
LL | if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
277277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -283,13 +283,13 @@ LL + if !matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr) {
283283
|
284284

285285
error: this boolean expression can be simplified
286-
--> tests/ui/nonminimal_bool.rs:251:8
286+
--> tests/ui/nonminimal_bool.rs:250:8
287287
|
288288
LL | if !S != true {}
289289
| ^^^^^^^^^^ help: try: `S == true`
290290

291291
error: inequality checks against true can be replaced by a negation
292-
--> tests/ui/nonminimal_bool.rs:251:8
292+
--> tests/ui/nonminimal_bool.rs:250:8
293293
|
294294
LL | if !S != true {}
295295
| ^^^^^^^^^^ help: try: `!!S`

tests/ui/nonminimal_bool_methods.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![allow(unused, clippy::diverging_sub_expression, clippy::needless_ifs)]
21
#![warn(clippy::nonminimal_bool)]
2+
#![expect(clippy::diverging_sub_expression, clippy::needless_ifs)]
33

44
fn methods_with_negation() {
55
let a: Option<i32> = unimplemented!();

tests/ui/nonminimal_bool_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![allow(unused, clippy::diverging_sub_expression, clippy::needless_ifs)]
21
#![warn(clippy::nonminimal_bool)]
2+
#![expect(clippy::diverging_sub_expression, clippy::needless_ifs)]
33

44
fn methods_with_negation() {
55
let a: Option<i32> = unimplemented!();

tests/ui/obfuscated_if_else.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(clippy::obfuscated_if_else)]
22
#![allow(
3-
clippy::unnecessary_lazy_evaluations,
43
clippy::unit_arg,
4+
clippy::unnecessary_lazy_evaluations,
55
clippy::unused_unit,
66
clippy::unwrap_or_default
77
)]

0 commit comments

Comments
 (0)