Skip to content

Commit bcfc0f9

Browse files
committed
make tests consistent
1 parent d063e09 commit bcfc0f9

21 files changed

+138
-110
lines changed

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.fixed

+2-1
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

+2-1
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

+2-2
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

+1
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

+7-2
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

+7-2
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

+19-19
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
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL + if let Some(n) = n.checked_sub(4) { n } else { n }
1313
|
1414

1515
error: the `dbg!` macro is intended as a debugging tool
16-
--> tests/ui/dbg_macro/dbg_macro.rs:11:8
16+
--> tests/ui/dbg_macro/dbg_macro.rs:16:8
1717
|
1818
LL | if dbg!(n <= 1) {
1919
| ^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL + if n <= 1 {
2525
|
2626

2727
error: the `dbg!` macro is intended as a debugging tool
28-
--> tests/ui/dbg_macro/dbg_macro.rs:14:9
28+
--> tests/ui/dbg_macro/dbg_macro.rs:19:9
2929
|
3030
LL | dbg!(1)
3131
| ^^^^^^^
@@ -37,7 +37,7 @@ LL + 1
3737
|
3838

3939
error: the `dbg!` macro is intended as a debugging tool
40-
--> tests/ui/dbg_macro/dbg_macro.rs:17:9
40+
--> tests/ui/dbg_macro/dbg_macro.rs:22:9
4141
|
4242
LL | dbg!(n * factorial(n - 1))
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL + n * factorial(n - 1)
4949
|
5050

5151
error: the `dbg!` macro is intended as a debugging tool
52-
--> tests/ui/dbg_macro/dbg_macro.rs:23:5
52+
--> tests/ui/dbg_macro/dbg_macro.rs:28:5
5353
|
5454
LL | dbg!(42);
5555
| ^^^^^^^^
@@ -61,7 +61,7 @@ LL + 42;
6161
|
6262

6363
error: the `dbg!` macro is intended as a debugging tool
64-
--> tests/ui/dbg_macro/dbg_macro.rs:26:14
64+
--> tests/ui/dbg_macro/dbg_macro.rs:31:14
6565
|
6666
LL | foo(3) + dbg!(factorial(4));
6767
| ^^^^^^^^^^^^^^^^^^
@@ -73,7 +73,7 @@ LL + foo(3) + factorial(4);
7373
|
7474

7575
error: the `dbg!` macro is intended as a debugging tool
76-
--> tests/ui/dbg_macro/dbg_macro.rs:29:5
76+
--> tests/ui/dbg_macro/dbg_macro.rs:34:5
7777
|
7878
LL | dbg!(1, 2, 3, 4, 5);
7979
| ^^^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL + (1, 2, 3, 4, 5);
8585
|
8686

8787
error: the `dbg!` macro is intended as a debugging tool
88-
--> tests/ui/dbg_macro/dbg_macro.rs:51:5
88+
--> tests/ui/dbg_macro/dbg_macro.rs:56:5
8989
|
9090
LL | dbg!();
9191
| ^^^^^^
@@ -96,7 +96,7 @@ LL - dbg!();
9696
|
9797

9898
error: the `dbg!` macro is intended as a debugging tool
99-
--> tests/ui/dbg_macro/dbg_macro.rs:55:13
99+
--> tests/ui/dbg_macro/dbg_macro.rs:60:13
100100
|
101101
LL | let _ = dbg!();
102102
| ^^^^^^
@@ -108,7 +108,7 @@ LL + let _ = ();
108108
|
109109

110110
error: the `dbg!` macro is intended as a debugging tool
111-
--> tests/ui/dbg_macro/dbg_macro.rs:58:9
111+
--> tests/ui/dbg_macro/dbg_macro.rs:63:9
112112
|
113113
LL | bar(dbg!());
114114
| ^^^^^^
@@ -120,7 +120,7 @@ LL + bar(());
120120
|
121121

122122
error: the `dbg!` macro is intended as a debugging tool
123-
--> tests/ui/dbg_macro/dbg_macro.rs:61:10
123+
--> tests/ui/dbg_macro/dbg_macro.rs:66:10
124124
|
125125
LL | foo!(dbg!());
126126
| ^^^^^^
@@ -132,7 +132,7 @@ LL + foo!(());
132132
|
133133

134134
error: the `dbg!` macro is intended as a debugging tool
135-
--> tests/ui/dbg_macro/dbg_macro.rs:64:16
135+
--> tests/ui/dbg_macro/dbg_macro.rs:69:16
136136
|
137137
LL | foo2!(foo!(dbg!()));
138138
| ^^^^^^
@@ -144,7 +144,7 @@ LL + foo2!(foo!(()));
144144
|
145145

146146
error: the `dbg!` macro is intended as a debugging tool
147-
--> tests/ui/dbg_macro/dbg_macro.rs:46:13
147+
--> tests/ui/dbg_macro/dbg_macro.rs:51:13
148148
|
149149
LL | dbg!();
150150
| ^^^^^^
@@ -159,7 +159,7 @@ LL - dbg!();
159159
|
160160

161161
error: the `dbg!` macro is intended as a debugging tool
162-
--> tests/ui/dbg_macro/dbg_macro.rs:87:9
162+
--> tests/ui/dbg_macro/dbg_macro.rs:92:9
163163
|
164164
LL | dbg!(2);
165165
| ^^^^^^^
@@ -171,7 +171,7 @@ LL + 2;
171171
|
172172

173173
error: the `dbg!` macro is intended as a debugging tool
174-
--> tests/ui/dbg_macro/dbg_macro.rs:94:5
174+
--> tests/ui/dbg_macro/dbg_macro.rs:99:5
175175
|
176176
LL | dbg!(1);
177177
| ^^^^^^^
@@ -183,7 +183,7 @@ LL + 1;
183183
|
184184

185185
error: the `dbg!` macro is intended as a debugging tool
186-
--> tests/ui/dbg_macro/dbg_macro.rs:100:5
186+
--> tests/ui/dbg_macro/dbg_macro.rs:105:5
187187
|
188188
LL | dbg!(1);
189189
| ^^^^^^^
@@ -195,7 +195,7 @@ LL + 1;
195195
|
196196

197197
error: the `dbg!` macro is intended as a debugging tool
198-
--> tests/ui/dbg_macro/dbg_macro.rs:107:9
198+
--> tests/ui/dbg_macro/dbg_macro.rs:112:9
199199
|
200200
LL | dbg!(1);
201201
| ^^^^^^^
@@ -207,7 +207,7 @@ LL + 1;
207207
|
208208

209209
error: the `dbg!` macro is intended as a debugging tool
210-
--> tests/ui/dbg_macro/dbg_macro.rs:114:31
210+
--> tests/ui/dbg_macro/dbg_macro.rs:119:31
211211
|
212212
LL | println!("dbg: {:?}", dbg!(s));
213213
| ^^^^^^^
@@ -219,7 +219,7 @@ LL + println!("dbg: {:?}", s);
219219
|
220220

221221
error: the `dbg!` macro is intended as a debugging tool
222-
--> tests/ui/dbg_macro/dbg_macro.rs:117:22
222+
--> tests/ui/dbg_macro/dbg_macro.rs:122:22
223223
|
224224
LL | print!("{}", dbg!(s));
225225
| ^^^^^^^

tests/ui/large_futures.fixed

+6-3
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

+6-3
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

+8-8
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

+1-1
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

+1-1
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

+4-1
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)