Skip to content

Commit 8fafe7a

Browse files
authored
test: remove extraneous #[allow(clippy::uninlined_format_args)] (#15799)
These were probably added automatically to avoid code churn. I'd like to get rid of them bit by bit, so here's the first bit changelog: none
2 parents 3ca0738 + e9ede27 commit 8fafe7a

37 files changed

+214
-231
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(clippy::uninlined_format_args)]
2-
31
fn main() {}
42

53
#[warn(clippy::cognitive_complexity)]
@@ -8,7 +6,7 @@ fn cognitive_complexity() {
86
let x = vec![1, 2, 3];
97
for i in x {
108
if i == 1 {
11-
println!("{}", i);
9+
println!("{i}");
1210
}
1311
}
1412
}

tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | blacklisted-names = [ "..", "wibble" ]
1111
| ^^^^^^^^^^^^^^^^^
1212

1313
error: the function has a cognitive complexity of (3/2)
14-
--> tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs:6:4
14+
--> tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs:4:4
1515
|
1616
LL | fn cognitive_complexity() {
1717
| ^^^^^^^^^^^^^^^^^^^^

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.fixed

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

43
fn below_limit() {

tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs

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

43
fn below_limit() {

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:6:17
2+
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:5: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:2:9
8+
--> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:1:9
99
|
1010
LL | #![deny(clippy::index_refutable_slice)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/bind_instead_of_map.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![deny(clippy::bind_instead_of_map)]
2-
#![allow(clippy::uninlined_format_args)]
32

43
// need a main anyway, use it get rid of unused warnings too
54
pub fn main() {

tests/ui/bind_instead_of_map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![deny(clippy::bind_instead_of_map)]
2-
#![allow(clippy::uninlined_format_args)]
32

43
// need a main anyway, use it get rid of unused warnings too
54
pub fn main() {

tests/ui/bind_instead_of_map.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: using `Option.and_then(Some)`, which is a no-op
2-
--> tests/ui/bind_instead_of_map.rs:8:13
2+
--> tests/ui/bind_instead_of_map.rs:7:13
33
|
44
LL | let _ = x.and_then(Some);
55
| ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
@@ -11,13 +11,13 @@ LL | #![deny(clippy::bind_instead_of_map)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
14-
--> tests/ui/bind_instead_of_map.rs:10:13
14+
--> tests/ui/bind_instead_of_map.rs:9:13
1515
|
1616
LL | let _ = x.and_then(|o| Some(o + 1));
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.map(|o| o + 1)`
1818

1919
error: using `Result.and_then(Ok)`, which is a no-op
20-
--> tests/ui/bind_instead_of_map.rs:17:13
20+
--> tests/ui/bind_instead_of_map.rs:16:13
2121
|
2222
LL | let _ = x.and_then(Ok);
2323
| ^^^^^^^^^^^^^^ help: use the expression directly: `x`

tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
22
#![allow(dead_code)]
3-
#![allow(clippy::uninlined_format_args)]
43
//@no-rustfix
54
// branches_sharing_code at the top and bottom of the if blocks
65

@@ -70,7 +69,7 @@ fn complexer_example() {
7069
let b = 0xffff00ff;
7170
let e_id = gen_id(a, b);
7271

73-
println!("From the a `{}` to the b `{}`", a, b);
72+
println!("From the a `{a}` to the b `{b}`");
7473

7574
let pack = DataPack {
7675
id: e_id,
@@ -83,7 +82,7 @@ fn complexer_example() {
8382
let b = 0xffff00ff;
8483
let e_id = gen_id(a, b);
8584

86-
println!("The new ID is '{}'", e_id);
85+
println!("The new ID is '{e_id}'");
8786

8887
let pack = DataPack {
8988
id: e_id,

tests/ui/branches_sharing_code/shared_at_top_and_bottom.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: all if blocks contain the same code at both the start and the end
2-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:17:5
2+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:16:5
33
|
44
LL | / if x == 7 {
55
LL | |
@@ -10,7 +10,7 @@ LL | | let _overlap_end = 2 * t;
1010
| |_________________________________^
1111
|
1212
note: this code is shared at the end
13-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:31:5
13+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:30:5
1414
|
1515
LL | / let _u = 9;
1616
LL | | }
@@ -34,7 +34,7 @@ LL + let _u = 9;
3434
|
3535

3636
error: all if blocks contain the same code at both the start and the end
37-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:35:5
37+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:34:5
3838
|
3939
LL | / if x == 99 {
4040
LL | |
@@ -45,7 +45,7 @@ LL | | let _overlap_middle = r * r;
4545
| |____________________________________^
4646
|
4747
note: this code is shared at the end
48-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:48:5
48+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:47:5
4949
|
5050
LL | / let _overlap_end = r * r * r;
5151
LL | | let z = "end";
@@ -67,7 +67,7 @@ LL + let z = "end";
6767
|
6868

6969
error: all if blocks contain the same code at both the start and the end
70-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:66:5
70+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:65:5
7171
|
7272
LL | / if (x > 7 && y < 13) || (x + y) % 2 == 1 {
7373
LL | |
@@ -78,7 +78,7 @@ LL | | let e_id = gen_id(a, b);
7878
| |________________________________^
7979
|
8080
note: this code is shared at the end
81-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:88:5
81+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:87:5
8282
|
8383
LL | / let pack = DataPack {
8484
LL | | id: e_id,
@@ -108,15 +108,15 @@ LL + process_data(pack);
108108
|
109109

110110
error: all if blocks contain the same code at both the start and the end
111-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:101:5
111+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:100:5
112112
|
113113
LL | / let _ = if x == 7 {
114114
... |
115115
LL | | let _ = 19;
116116
| |___________________^
117117
|
118118
note: this code is shared at the end
119-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:112:5
119+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:111:5
120120
|
121121
LL | / x << 2
122122
LL | | };
@@ -134,15 +134,15 @@ LL ~ x << 2;
134134
|
135135

136136
error: all if blocks contain the same code at both the start and the end
137-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:115:5
137+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:114:5
138138
|
139139
LL | / if x == 9 {
140140
... |
141141
LL | | let _ = 17;
142142
| |___________________^
143143
|
144144
note: this code is shared at the end
145-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:126:5
145+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:125:5
146146
|
147147
LL | / x * 4
148148
LL | | }
@@ -160,15 +160,15 @@ LL + x * 4
160160
|
161161

162162
error: all if blocks contain the same code at both the start and the end
163-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:158:9
163+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:157:9
164164
|
165165
LL | / if false {
166166
LL | |
167167
LL | | let x = 1;
168168
| |______________________^
169169
|
170170
note: this code is shared at the end
171-
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:166:9
171+
--> tests/ui/branches_sharing_code/shared_at_top_and_bottom.rs:165:9
172172
|
173173
LL | / let y = 1;
174174
LL | | }

0 commit comments

Comments
 (0)