Skip to content

Commit b26f9f3

Browse files
committed
make tests consistent
1 parent 3cce21d commit b26f9f3

23 files changed

+236
-206
lines changed

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![deny(clippy::index_refutable_slice)]
21
#![allow(clippy::uninlined_format_args)]
2+
#![deny(clippy::index_refutable_slice)]
3+
34
fn below_limit() {
45
let slice: Option<&[u32]> = Some(&[1, 2, 3]);
56
if let Some([_, _, _, _, _, _, _, slice_7, ..]) = slice {

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![deny(clippy::index_refutable_slice)]
21
#![allow(clippy::uninlined_format_args)]
2+
#![deny(clippy::index_refutable_slice)]
3+
34
fn below_limit() {
45
let slice: Option<&[u32]> = Some(&[1, 2, 3]);
56
if let Some(slice) = slice {

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: this binding can be a slice pattern to avoid indexing
2-
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:5:17
2+
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:6:17
33
|
44
LL | if let Some(slice) = slice {
55
| ^^^^^
66
|
77
note: the lint level is defined here
8-
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:1:9
8+
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:2:9
99
|
1010
LL | #![deny(clippy::index_refutable_slice)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/author/macro_in_closure.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ check-pass
2+
23
#![allow(clippy::uninlined_format_args)]
34

45
fn main() {

tests/ui/dbg_macro/dbg_macro.fixed

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
#![allow(
2+
clippy::no_effect,
3+
clippy::uninlined_format_args,
4+
clippy::unit_arg,
5+
clippy::unnecessary_operation
6+
)]
17
#![warn(clippy::dbg_macro)]
2-
#![allow(clippy::unnecessary_operation, clippy::no_effect, clippy::unit_arg)]
3-
#![allow(clippy::uninlined_format_args)]
8+
49
fn foo(n: u32) -> u32 {
510
if let Some(n) = n.checked_sub(4) { n } else { n }
611
//~^ dbg_macro

tests/ui/dbg_macro/dbg_macro.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
#![allow(
2+
clippy::no_effect,
3+
clippy::uninlined_format_args,
4+
clippy::unit_arg,
5+
clippy::unnecessary_operation
6+
)]
17
#![warn(clippy::dbg_macro)]
2-
#![allow(clippy::unnecessary_operation, clippy::no_effect, clippy::unit_arg)]
3-
#![allow(clippy::uninlined_format_args)]
8+
49
fn foo(n: u32) -> u32 {
510
if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
611
//~^ dbg_macro

tests/ui/dbg_macro/dbg_macro.stderr

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: the `dbg!` macro is intended as a debugging tool
2-
--> tests/ui/dbg_macro/dbg_macro.rs:5:22
2+
--> tests/ui/dbg_macro/dbg_macro.rs:10:22
33
|
44
LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
55
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL | if let Some(n) = n.checked_sub(4) { n } else { n }
1212
| ~~~~~~~~~~~~~~~~
1313

1414
error: the `dbg!` macro is intended as a debugging tool
15-
--> tests/ui/dbg_macro/dbg_macro.rs:11:8
15+
--> tests/ui/dbg_macro/dbg_macro.rs:16:8
1616
|
1717
LL | if dbg!(n <= 1) {
1818
| ^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | if n <= 1 {
2323
| ~~~~~~
2424

2525
error: the `dbg!` macro is intended as a debugging tool
26-
--> tests/ui/dbg_macro/dbg_macro.rs:14:9
26+
--> tests/ui/dbg_macro/dbg_macro.rs:19:9
2727
|
2828
LL | dbg!(1)
2929
| ^^^^^^^
@@ -34,7 +34,7 @@ LL | 1
3434
|
3535

3636
error: the `dbg!` macro is intended as a debugging tool
37-
--> tests/ui/dbg_macro/dbg_macro.rs:17:9
37+
--> tests/ui/dbg_macro/dbg_macro.rs:22:9
3838
|
3939
LL | dbg!(n * factorial(n - 1))
4040
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,7 +45,7 @@ LL | n * factorial(n - 1)
4545
|
4646

4747
error: the `dbg!` macro is intended as a debugging tool
48-
--> tests/ui/dbg_macro/dbg_macro.rs:23:5
48+
--> tests/ui/dbg_macro/dbg_macro.rs:28:5
4949
|
5050
LL | dbg!(42);
5151
| ^^^^^^^^
@@ -56,7 +56,7 @@ LL | 42;
5656
| ~~
5757

5858
error: the `dbg!` macro is intended as a debugging tool
59-
--> tests/ui/dbg_macro/dbg_macro.rs:26:14
59+
--> tests/ui/dbg_macro/dbg_macro.rs:31:14
6060
|
6161
LL | foo(3) + dbg!(factorial(4));
6262
| ^^^^^^^^^^^^^^^^^^
@@ -67,7 +67,7 @@ LL | foo(3) + factorial(4);
6767
| ~~~~~~~~~~~~
6868

6969
error: the `dbg!` macro is intended as a debugging tool
70-
--> tests/ui/dbg_macro/dbg_macro.rs:29:5
70+
--> tests/ui/dbg_macro/dbg_macro.rs:34:5
7171
|
7272
LL | dbg!(1, 2, 3, 4, 5);
7373
| ^^^^^^^^^^^^^^^^^^^
@@ -78,7 +78,7 @@ LL | (1, 2, 3, 4, 5);
7878
| ~~~~~~~~~~~~~~~
7979

8080
error: the `dbg!` macro is intended as a debugging tool
81-
--> tests/ui/dbg_macro/dbg_macro.rs:51:5
81+
--> tests/ui/dbg_macro/dbg_macro.rs:56:5
8282
|
8383
LL | dbg!();
8484
| ^^^^^^
@@ -89,7 +89,7 @@ LL - dbg!();
8989
|
9090

9191
error: the `dbg!` macro is intended as a debugging tool
92-
--> tests/ui/dbg_macro/dbg_macro.rs:55:13
92+
--> tests/ui/dbg_macro/dbg_macro.rs:60:13
9393
|
9494
LL | let _ = dbg!();
9595
| ^^^^^^
@@ -100,7 +100,7 @@ LL | let _ = ();
100100
| ~~
101101

102102
error: the `dbg!` macro is intended as a debugging tool
103-
--> tests/ui/dbg_macro/dbg_macro.rs:58:9
103+
--> tests/ui/dbg_macro/dbg_macro.rs:63:9
104104
|
105105
LL | bar(dbg!());
106106
| ^^^^^^
@@ -111,7 +111,7 @@ LL | bar(());
111111
| ~~
112112

113113
error: the `dbg!` macro is intended as a debugging tool
114-
--> tests/ui/dbg_macro/dbg_macro.rs:61:10
114+
--> tests/ui/dbg_macro/dbg_macro.rs:66:10
115115
|
116116
LL | foo!(dbg!());
117117
| ^^^^^^
@@ -122,7 +122,7 @@ LL | foo!(());
122122
| ~~
123123

124124
error: the `dbg!` macro is intended as a debugging tool
125-
--> tests/ui/dbg_macro/dbg_macro.rs:64:16
125+
--> tests/ui/dbg_macro/dbg_macro.rs:69:16
126126
|
127127
LL | foo2!(foo!(dbg!()));
128128
| ^^^^^^
@@ -133,7 +133,7 @@ LL | foo2!(foo!(()));
133133
| ~~
134134

135135
error: the `dbg!` macro is intended as a debugging tool
136-
--> tests/ui/dbg_macro/dbg_macro.rs:46:13
136+
--> tests/ui/dbg_macro/dbg_macro.rs:51:13
137137
|
138138
LL | dbg!();
139139
| ^^^^^^
@@ -148,7 +148,7 @@ LL - dbg!();
148148
|
149149

150150
error: the `dbg!` macro is intended as a debugging tool
151-
--> tests/ui/dbg_macro/dbg_macro.rs:87:9
151+
--> tests/ui/dbg_macro/dbg_macro.rs:92:9
152152
|
153153
LL | dbg!(2);
154154
| ^^^^^^^
@@ -159,7 +159,7 @@ LL | 2;
159159
| ~
160160

161161
error: the `dbg!` macro is intended as a debugging tool
162-
--> tests/ui/dbg_macro/dbg_macro.rs:94:5
162+
--> tests/ui/dbg_macro/dbg_macro.rs:99:5
163163
|
164164
LL | dbg!(1);
165165
| ^^^^^^^
@@ -170,7 +170,7 @@ LL | 1;
170170
| ~
171171

172172
error: the `dbg!` macro is intended as a debugging tool
173-
--> tests/ui/dbg_macro/dbg_macro.rs:100:5
173+
--> tests/ui/dbg_macro/dbg_macro.rs:105:5
174174
|
175175
LL | dbg!(1);
176176
| ^^^^^^^
@@ -181,7 +181,7 @@ LL | 1;
181181
| ~
182182

183183
error: the `dbg!` macro is intended as a debugging tool
184-
--> tests/ui/dbg_macro/dbg_macro.rs:107:9
184+
--> tests/ui/dbg_macro/dbg_macro.rs:112:9
185185
|
186186
LL | dbg!(1);
187187
| ^^^^^^^
@@ -192,7 +192,7 @@ LL | 1;
192192
| ~
193193

194194
error: the `dbg!` macro is intended as a debugging tool
195-
--> tests/ui/dbg_macro/dbg_macro.rs:114:31
195+
--> tests/ui/dbg_macro/dbg_macro.rs:119:31
196196
|
197197
LL | println!("dbg: {:?}", dbg!(s));
198198
| ^^^^^^^
@@ -203,7 +203,7 @@ LL | println!("dbg: {:?}", s);
203203
| ~
204204

205205
error: the `dbg!` macro is intended as a debugging tool
206-
--> tests/ui/dbg_macro/dbg_macro.rs:117:22
206+
--> tests/ui/dbg_macro/dbg_macro.rs:122:22
207207
|
208208
LL | print!("{}", dbg!(s));
209209
| ^^^^^^^

tests/ui/large_futures.fixed

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#![allow(
2+
clippy::future_not_send,
3+
clippy::manual_async_fn,
4+
clippy::never_loop,
5+
clippy::uninlined_format_args
6+
)]
17
#![warn(clippy::large_futures)]
2-
#![allow(clippy::never_loop)]
3-
#![allow(clippy::future_not_send)]
4-
#![allow(clippy::manual_async_fn, clippy::uninlined_format_args)]
58

69
async fn big_fut(_arg: [u8; 1024 * 16]) {}
710

tests/ui/large_futures.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#![allow(
2+
clippy::future_not_send,
3+
clippy::manual_async_fn,
4+
clippy::never_loop,
5+
clippy::uninlined_format_args
6+
)]
17
#![warn(clippy::large_futures)]
2-
#![allow(clippy::never_loop)]
3-
#![allow(clippy::future_not_send)]
4-
#![allow(clippy::manual_async_fn, clippy::uninlined_format_args)]
58

69
async fn big_fut(_arg: [u8; 1024 * 16]) {}
710

tests/ui/large_futures.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: large future with a size of 16385 bytes
2-
--> tests/ui/large_futures.rs:10:9
2+
--> tests/ui/large_futures.rs:13:9
33
|
44
LL | big_fut([0u8; 1024 * 16]).await;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(big_fut([0u8; 1024 * 16]))`
@@ -8,37 +8,37 @@ LL | big_fut([0u8; 1024 * 16]).await;
88
= help: to override `-D warnings` add `#[allow(clippy::large_futures)]`
99

1010
error: large future with a size of 16386 bytes
11-
--> tests/ui/large_futures.rs:13:5
11+
--> tests/ui/large_futures.rs:16:5
1212
|
1313
LL | f.await
1414
| ^ help: consider `Box::pin` on it: `Box::pin(f)`
1515

1616
error: large future with a size of 16387 bytes
17-
--> tests/ui/large_futures.rs:18:9
17+
--> tests/ui/large_futures.rs:21:9
1818
|
1919
LL | wait().await;
2020
| ^^^^^^ help: consider `Box::pin` on it: `Box::pin(wait())`
2121

2222
error: large future with a size of 16387 bytes
23-
--> tests/ui/large_futures.rs:24:13
23+
--> tests/ui/large_futures.rs:27:13
2424
|
2525
LL | wait().await;
2626
| ^^^^^^ help: consider `Box::pin` on it: `Box::pin(wait())`
2727

2828
error: large future with a size of 65540 bytes
29-
--> tests/ui/large_futures.rs:32:5
29+
--> tests/ui/large_futures.rs:35:5
3030
|
3131
LL | foo().await;
3232
| ^^^^^ help: consider `Box::pin` on it: `Box::pin(foo())`
3333

3434
error: large future with a size of 49159 bytes
35-
--> tests/ui/large_futures.rs:35:5
35+
--> tests/ui/large_futures.rs:38:5
3636
|
3737
LL | calls_fut(fut).await;
3838
| ^^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(calls_fut(fut))`
3939

4040
error: large future with a size of 65540 bytes
41-
--> tests/ui/large_futures.rs:48:5
41+
--> tests/ui/large_futures.rs:51:5
4242
|
4343
LL | / async {
4444
LL | |
@@ -61,7 +61,7 @@ LL + })
6161
|
6262

6363
error: large future with a size of 65540 bytes
64-
--> tests/ui/large_futures.rs:61:13
64+
--> tests/ui/large_futures.rs:64:13
6565
|
6666
LL | / async {
6767
LL | |

tests/ui/manual_inspect.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![warn(clippy::manual_inspect)]
21
#![allow(clippy::no_effect, clippy::op_ref, clippy::uninlined_format_args)]
2+
#![warn(clippy::manual_inspect)]
33

44
fn main() {
55
let _ = Some(0).inspect(|&x| {

tests/ui/manual_inspect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![warn(clippy::manual_inspect)]
21
#![allow(clippy::no_effect, clippy::op_ref, clippy::uninlined_format_args)]
2+
#![warn(clippy::manual_inspect)]
33

44
fn main() {
55
let _ = Some(0).map(|x| {

tests/ui/needless_pass_by_ref_mut.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@no-rustfix
2+
13
#![allow(
24
clippy::if_same_then_else,
35
clippy::no_effect,
@@ -6,8 +8,9 @@
68
clippy::uninlined_format_args
79
)]
810
#![warn(clippy::needless_pass_by_ref_mut)]
9-
//@no-rustfix
11+
1012
use std::ptr::NonNull;
13+
1114
fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) {
1215
//~^ needless_pass_by_ref_mut
1316

0 commit comments

Comments
 (0)