Skip to content

Commit 7ed3e41

Browse files
committed
Attributes cleanup in tests [10/20]
1 parent aede4dc commit 7ed3e41

97 files changed

Lines changed: 517 additions & 642 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/let_with_type_underscore.fixed

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@aux-build: proc_macros.rs
2-
#![allow(unused)]
32
#![warn(clippy::let_with_type_underscore)]
4-
#![allow(clippy::let_unit_value, clippy::needless_late_init)]
3+
#![allow(clippy::needless_late_init)]
54

65
extern crate proc_macros;
76

tests/ui/let_with_type_underscore.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@aux-build: proc_macros.rs
2-
#![allow(unused)]
32
#![warn(clippy::let_with_type_underscore)]
4-
#![allow(clippy::let_unit_value, clippy::needless_late_init)]
3+
#![allow(clippy::needless_late_init)]
54

65
extern crate proc_macros;
76

tests/ui/let_with_type_underscore.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: variable declared with type underscore
2-
--> tests/ui/let_with_type_underscore.rs:15:5
2+
--> tests/ui/let_with_type_underscore.rs:14:5
33
|
44
LL | let x: _ = 1;
55
| ^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL + let x = 1;
1313
|
1414

1515
error: variable declared with type underscore
16-
--> tests/ui/let_with_type_underscore.rs:17:5
16+
--> tests/ui/let_with_type_underscore.rs:16:5
1717
|
1818
LL | let _: _ = 2;
1919
| ^^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL + let _ = 2;
2525
|
2626

2727
error: variable declared with type underscore
28-
--> tests/ui/let_with_type_underscore.rs:19:5
28+
--> tests/ui/let_with_type_underscore.rs:18:5
2929
|
3030
LL | let x: _ = func();
3131
| ^^^^^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL + let x = func();
3737
|
3838

3939
error: variable declared with type underscore
40-
--> tests/ui/let_with_type_underscore.rs:21:5
40+
--> tests/ui/let_with_type_underscore.rs:20:5
4141
|
4242
LL | let x: _;
4343
| ^^^^^^^^^
@@ -49,7 +49,7 @@ LL + let x;
4949
|
5050

5151
error: variable declared with type underscore
52-
--> tests/ui/let_with_type_underscore.rs:29:5
52+
--> tests/ui/let_with_type_underscore.rs:28:5
5353
|
5454
LL | let x : _ = 1;
5555
| ^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL + let x = 1;
6161
|
6262

6363
error: variable declared with type underscore
64-
--> tests/ui/let_with_type_underscore.rs:50:5
64+
--> tests/ui/let_with_type_underscore.rs:49:5
6565
|
6666
LL | let (a): _ = 0;
6767
| ^^^^^^^^^^^^^^^
@@ -73,7 +73,7 @@ LL + let (a) = 0;
7373
|
7474

7575
error: variable declared with type underscore
76-
--> tests/ui/let_with_type_underscore.rs:52:5
76+
--> tests/ui/let_with_type_underscore.rs:51:5
7777
|
7878
LL | let ((a)): _ = 0;
7979
| ^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL + let ((a)) = 0;
8585
|
8686

8787
error: variable declared with type underscore
88-
--> tests/ui/let_with_type_underscore.rs:54:5
88+
--> tests/ui/let_with_type_underscore.rs:53:5
8989
|
9090
LL | let ((a,)): _ = (0,);
9191
| ^^^^^^^^^^^^^^^^^^^^^
@@ -97,7 +97,7 @@ LL + let ((a,)) = (0,);
9797
|
9898

9999
error: variable declared with type underscore
100-
--> tests/ui/let_with_type_underscore.rs:57:5
100+
--> tests/ui/let_with_type_underscore.rs:56:5
101101
|
102102
LL | let ( (a ) ): _ = 0;
103103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/lines_filter_map_ok.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::map_identity)]
1+
#![expect(clippy::map_identity)]
22
#![warn(clippy::lines_filter_map_ok)]
33

44
use std::io::{self, BufRead, BufReader};

tests/ui/lines_filter_map_ok.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::map_identity)]
1+
#![expect(clippy::map_identity)]
22
#![warn(clippy::lines_filter_map_ok)]
33

44
use std::io::{self, BufRead, BufReader};

tests/ui/linkedlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(associated_type_defaults)]
22
#![warn(clippy::linkedlist)]
3-
#![allow(unused, dead_code, clippy::needless_pass_by_value)]
3+
#![expect(clippy::needless_pass_by_value)]
44

55
extern crate alloc;
66
use alloc::collections::linked_list::LinkedList;

tests/ui/literal_string_with_formatting_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::literal_string_with_formatting_args)]
2-
#![allow(clippy::unnecessary_literal_unwrap)]
2+
#![expect(clippy::unnecessary_literal_unwrap)]
33

44
// Regression test for <https://github.com/rust-lang/rust-clippy/issues/13885>.
55
// It's not supposed to emit the lint in this case (in `assert!` expansion).

tests/ui/literals.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
//@no-rustfix: overlapping suggestions
22
// does not test any rustfixable lints
33

4-
#![warn(clippy::mixed_case_hex_literals)]
5-
#![warn(clippy::zero_prefixed_literal)]
6-
#![warn(clippy::unseparated_literal_suffix)]
7-
#![warn(clippy::separated_literal_suffix)]
8-
#![allow(dead_code, overflowing_literals)]
4+
#![warn(
5+
clippy::mixed_case_hex_literals,
6+
clippy::separated_literal_suffix,
7+
clippy::unseparated_literal_suffix,
8+
clippy::zero_prefixed_literal
9+
)]
10+
#![expect(overflowing_literals)]
911

1012
fn main() {
1113
let ok1 = 0xABCD;

tests/ui/literals.stderr

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: integer type suffix should not be separated by an underscore
2-
--> tests/ui/literals.rs:13:15
2+
--> tests/ui/literals.rs:15:15
33
|
44
LL | let ok4 = 0xab_cd_i32;
55
| ^^^^^^^^^^^ help: remove the underscore: `0xab_cdi32`
@@ -8,19 +8,19 @@ LL | let ok4 = 0xab_cd_i32;
88
= help: to override `-D warnings` add `#[allow(clippy::separated_literal_suffix)]`
99

1010
error: integer type suffix should not be separated by an underscore
11-
--> tests/ui/literals.rs:16:15
11+
--> tests/ui/literals.rs:18:15
1212
|
1313
LL | let ok5 = 0xAB_CD_u32;
1414
| ^^^^^^^^^^^ help: remove the underscore: `0xAB_CDu32`
1515

1616
error: integer type suffix should not be separated by an underscore
17-
--> tests/ui/literals.rs:19:15
17+
--> tests/ui/literals.rs:21:15
1818
|
1919
LL | let ok5 = 0xAB_CD_isize;
2020
| ^^^^^^^^^^^^^ help: remove the underscore: `0xAB_CDisize`
2121

2222
error: inconsistent casing in hexadecimal literal
23-
--> tests/ui/literals.rs:22:17
23+
--> tests/ui/literals.rs:24:17
2424
|
2525
LL | let fail1 = 0xabCD;
2626
| ^^^^^^
@@ -30,49 +30,49 @@ LL | let fail1 = 0xabCD;
3030
= help: to override `-D warnings` add `#[allow(clippy::mixed_case_hex_literals)]`
3131

3232
error: integer type suffix should not be separated by an underscore
33-
--> tests/ui/literals.rs:25:17
33+
--> tests/ui/literals.rs:27:17
3434
|
3535
LL | let fail2 = 0xabCD_u32;
3636
| ^^^^^^^^^^ help: remove the underscore: `0xabCDu32`
3737

3838
error: inconsistent casing in hexadecimal literal
39-
--> tests/ui/literals.rs:25:17
39+
--> tests/ui/literals.rs:27:17
4040
|
4141
LL | let fail2 = 0xabCD_u32;
4242
| ^^^^^^^^^^
4343
|
4444
= help: consider using `0xabcd_u32` or `0xABCD_u32`
4545

4646
error: integer type suffix should not be separated by an underscore
47-
--> tests/ui/literals.rs:29:17
47+
--> tests/ui/literals.rs:31:17
4848
|
4949
LL | let fail2 = 0xabCD_isize;
5050
| ^^^^^^^^^^^^ help: remove the underscore: `0xabCDisize`
5151

5252
error: inconsistent casing in hexadecimal literal
53-
--> tests/ui/literals.rs:29:17
53+
--> tests/ui/literals.rs:31:17
5454
|
5555
LL | let fail2 = 0xabCD_isize;
5656
| ^^^^^^^^^^^^
5757
|
5858
= help: consider using `0xabcd_isize` or `0xABCD_isize`
5959

6060
error: integer type suffix should not be separated by an underscore
61-
--> tests/ui/literals.rs:33:17
61+
--> tests/ui/literals.rs:35:17
6262
|
6363
LL | let fail2 = 0xab_CD_isize;
6464
| ^^^^^^^^^^^^^ help: remove the underscore: `0xab_CDisize`
6565

6666
error: inconsistent casing in hexadecimal literal
67-
--> tests/ui/literals.rs:33:17
67+
--> tests/ui/literals.rs:35:17
6868
|
6969
LL | let fail2 = 0xab_CD_isize;
7070
| ^^^^^^^^^^^^^
7171
|
7272
= help: consider using `0xab_cd_isize` or `0xAB_CD_isize`
7373

7474
error: integer type suffix should be separated by an underscore
75-
--> tests/ui/literals.rs:37:27
75+
--> tests/ui/literals.rs:39:27
7676
|
7777
LL | let fail_multi_zero = 000_123usize;
7878
| ^^^^^^^^^^^^ help: add an underscore: `000_123_usize`
@@ -81,7 +81,7 @@ LL | let fail_multi_zero = 000_123usize;
8181
= help: to override `-D warnings` add `#[allow(clippy::unseparated_literal_suffix)]`
8282

8383
error: this is a decimal constant
84-
--> tests/ui/literals.rs:37:27
84+
--> tests/ui/literals.rs:39:27
8585
|
8686
LL | let fail_multi_zero = 000_123usize;
8787
| ^^^^^^^^^^^^
@@ -100,13 +100,13 @@ LL + let fail_multi_zero = 0o123usize;
100100
|
101101

102102
error: integer type suffix should not be separated by an underscore
103-
--> tests/ui/literals.rs:42:16
103+
--> tests/ui/literals.rs:44:16
104104
|
105105
LL | let ok10 = 0_i64;
106106
| ^^^^^ help: remove the underscore: `0i64`
107107

108108
error: this is a decimal constant
109-
--> tests/ui/literals.rs:45:17
109+
--> tests/ui/literals.rs:47:17
110110
|
111111
LL | let fail8 = 0123;
112112
| ^^^^
@@ -122,13 +122,13 @@ LL | let fail8 = 0o123;
122122
| +
123123

124124
error: integer type suffix should not be separated by an underscore
125-
--> tests/ui/literals.rs:55:16
125+
--> tests/ui/literals.rs:57:16
126126
|
127127
LL | let ok17 = 0x123_4567_8901_usize;
128128
| ^^^^^^^^^^^^^^^^^^^^^ help: remove the underscore: `0x123_4567_8901usize`
129129

130130
error: digits grouped inconsistently by underscores
131-
--> tests/ui/literals.rs:60:18
131+
--> tests/ui/literals.rs:62:18
132132
|
133133
LL | let fail19 = 12_3456_21;
134134
| ^^^^^^^^^^ help: consider: `12_345_621`
@@ -137,19 +137,19 @@ LL | let fail19 = 12_3456_21;
137137
= help: to override `-D warnings` add `#[allow(clippy::inconsistent_digit_grouping)]`
138138

139139
error: digits grouped inconsistently by underscores
140-
--> tests/ui/literals.rs:63:18
140+
--> tests/ui/literals.rs:65:18
141141
|
142142
LL | let fail22 = 3__4___23;
143143
| ^^^^^^^^^ help: consider: `3_423`
144144

145145
error: digits grouped inconsistently by underscores
146-
--> tests/ui/literals.rs:66:18
146+
--> tests/ui/literals.rs:68:18
147147
|
148148
LL | let fail23 = 3__16___23;
149149
| ^^^^^^^^^^ help: consider: `31_623`
150150

151151
error: digits of hex, binary or octal literal not in groups of equal size
152-
--> tests/ui/literals.rs:69:18
152+
--> tests/ui/literals.rs:71:18
153153
|
154154
LL | let fail24 = 0xAB_ABC_AB;
155155
| ^^^^^^^^^^^ help: consider: `0x0ABA_BCAB`
@@ -158,7 +158,7 @@ LL | let fail24 = 0xAB_ABC_AB;
158158
= help: to override `-D warnings` add `#[allow(clippy::unusual_byte_groupings)]`
159159

160160
error: this is a decimal constant
161-
--> tests/ui/literals.rs:79:13
161+
--> tests/ui/literals.rs:81:13
162162
|
163163
LL | let _ = 08;
164164
| ^^
@@ -170,7 +170,7 @@ LL + let _ = 8;
170170
|
171171

172172
error: this is a decimal constant
173-
--> tests/ui/literals.rs:82:13
173+
--> tests/ui/literals.rs:84:13
174174
|
175175
LL | let _ = 09;
176176
| ^^
@@ -182,7 +182,7 @@ LL + let _ = 9;
182182
|
183183

184184
error: this is a decimal constant
185-
--> tests/ui/literals.rs:85:13
185+
--> tests/ui/literals.rs:87:13
186186
|
187187
LL | let _ = 089;
188188
| ^^^

tests/ui/lossy_float_literal.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::lossy_float_literal)]
2-
#![allow(overflowing_literals, unused)]
2+
#![expect(overflowing_literals)]
33
#![feature(f128)]
44
#![feature(f16)]
55

0 commit comments

Comments
 (0)