Skip to content

Commit 2f90b2a

Browse files
committed
Auto merge of #9547 - nyurik:capt, r=flip1995
fallout: fix tests to allow uninlined_format_args In order to switch `clippy::uninlined_format_args` from pedantic to style, all existing tests must not raise a warning. I did not want to change the actual tests, so this is a relatively minor change that: * add `#![allow(clippy::uninlined_format_args)]` where needed * normalizes all allow/deny/warn attributes * all allow attributes are grouped together * sorted alphabetically * the `clippy::*` attributes are listed separate from the other ones. * deny and warn attributes are listed before the allowed ones See also #9233, #9525, #9527 cc: `@llogiq` `@Alexendoo` changelog: none
2 parents e8c1b54 + eb39702 commit 2f90b2a

File tree

181 files changed

+1021
-984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+1021
-984
lines changed

tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::uninlined_format_args)]
2+
13
fn main() {}
24

35
#[warn(clippy::cognitive_complexity)]

tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ warning: error reading Clippy's configuration file `$DIR/clippy.toml`: deprecate
33
warning: error reading Clippy's configuration file `$DIR/clippy.toml`: deprecated field `blacklisted-names`. Please use `disallowed-names` instead
44

55
error: the function has a cognitive complexity of (3/2)
6-
--> $DIR/conf_deprecated_key.rs:4:4
6+
--> $DIR/conf_deprecated_key.rs:6:4
77
|
88
LL | fn cognitive_complexity() {
99
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/assign_ops2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::uninlined_format_args)]
2+
13
#[allow(unused_assignments)]
24
#[warn(clippy::misrefactored_assign_op, clippy::assign_op_pattern)]
35
fn main() {

tests/ui/assign_ops2.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: variable appears on both sides of an assignment operation
2-
--> $DIR/assign_ops2.rs:5:5
2+
--> $DIR/assign_ops2.rs:7:5
33
|
44
LL | a += a + 1;
55
| ^^^^^^^^^^
@@ -15,7 +15,7 @@ LL | a = a + a + 1;
1515
| ~~~~~~~~~~~~~
1616

1717
error: variable appears on both sides of an assignment operation
18-
--> $DIR/assign_ops2.rs:6:5
18+
--> $DIR/assign_ops2.rs:8:5
1919
|
2020
LL | a += 1 + a;
2121
| ^^^^^^^^^^
@@ -30,7 +30,7 @@ LL | a = a + 1 + a;
3030
| ~~~~~~~~~~~~~
3131

3232
error: variable appears on both sides of an assignment operation
33-
--> $DIR/assign_ops2.rs:7:5
33+
--> $DIR/assign_ops2.rs:9:5
3434
|
3535
LL | a -= a - 1;
3636
| ^^^^^^^^^^
@@ -45,7 +45,7 @@ LL | a = a - (a - 1);
4545
| ~~~~~~~~~~~~~~~
4646

4747
error: variable appears on both sides of an assignment operation
48-
--> $DIR/assign_ops2.rs:8:5
48+
--> $DIR/assign_ops2.rs:10:5
4949
|
5050
LL | a *= a * 99;
5151
| ^^^^^^^^^^^
@@ -60,7 +60,7 @@ LL | a = a * a * 99;
6060
| ~~~~~~~~~~~~~~
6161

6262
error: variable appears on both sides of an assignment operation
63-
--> $DIR/assign_ops2.rs:9:5
63+
--> $DIR/assign_ops2.rs:11:5
6464
|
6565
LL | a *= 42 * a;
6666
| ^^^^^^^^^^^
@@ -75,7 +75,7 @@ LL | a = a * 42 * a;
7575
| ~~~~~~~~~~~~~~
7676

7777
error: variable appears on both sides of an assignment operation
78-
--> $DIR/assign_ops2.rs:10:5
78+
--> $DIR/assign_ops2.rs:12:5
7979
|
8080
LL | a /= a / 2;
8181
| ^^^^^^^^^^
@@ -90,7 +90,7 @@ LL | a = a / (a / 2);
9090
| ~~~~~~~~~~~~~~~
9191

9292
error: variable appears on both sides of an assignment operation
93-
--> $DIR/assign_ops2.rs:11:5
93+
--> $DIR/assign_ops2.rs:13:5
9494
|
9595
LL | a %= a % 5;
9696
| ^^^^^^^^^^
@@ -105,7 +105,7 @@ LL | a = a % (a % 5);
105105
| ~~~~~~~~~~~~~~~
106106

107107
error: variable appears on both sides of an assignment operation
108-
--> $DIR/assign_ops2.rs:12:5
108+
--> $DIR/assign_ops2.rs:14:5
109109
|
110110
LL | a &= a & 1;
111111
| ^^^^^^^^^^
@@ -120,7 +120,7 @@ LL | a = a & a & 1;
120120
| ~~~~~~~~~~~~~
121121

122122
error: variable appears on both sides of an assignment operation
123-
--> $DIR/assign_ops2.rs:13:5
123+
--> $DIR/assign_ops2.rs:15:5
124124
|
125125
LL | a *= a * a;
126126
| ^^^^^^^^^^
@@ -135,7 +135,7 @@ LL | a = a * a * a;
135135
| ~~~~~~~~~~~~~
136136

137137
error: manual implementation of an assign operation
138-
--> $DIR/assign_ops2.rs:50:5
138+
--> $DIR/assign_ops2.rs:52:5
139139
|
140140
LL | buf = buf + cows.clone();
141141
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buf += cows.clone()`

tests/ui/auxiliary/proc_macro_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![crate_type = "proc-macro"]
55
#![feature(repr128, proc_macro_hygiene, proc_macro_quote, box_patterns)]
66
#![allow(incomplete_features)]
7-
#![allow(clippy::useless_conversion)]
7+
#![allow(clippy::useless_conversion, clippy::uninlined_format_args)]
88

99
extern crate proc_macro;
1010
extern crate quote;

tests/ui/bind_instead_of_map.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![deny(clippy::bind_instead_of_map)]
3+
#![allow(clippy::uninlined_format_args)]
34

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

tests/ui/bind_instead_of_map.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![deny(clippy::bind_instead_of_map)]
3+
#![allow(clippy::uninlined_format_args)]
34

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

tests/ui/bind_instead_of_map.stderr

+3-3
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-
--> $DIR/bind_instead_of_map.rs:8:13
2+
--> $DIR/bind_instead_of_map.rs:9: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-
--> $DIR/bind_instead_of_map.rs:9:13
14+
--> $DIR/bind_instead_of_map.rs:10:13
1515
|
1616
LL | let _ = x.and_then(|o| Some(o + 1));
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `x.map(|o| o + 1)`
1818

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

tests/ui/borrow_box.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![deny(clippy::borrowed_box)]
2-
#![allow(clippy::disallowed_names)]
3-
#![allow(unused_variables)]
4-
#![allow(dead_code)]
2+
#![allow(dead_code, unused_variables)]
3+
#![allow(clippy::uninlined_format_args, clippy::disallowed_names)]
54

65
use std::fmt::Display;
76

tests/ui/borrow_box.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
2-
--> $DIR/borrow_box.rs:21:14
2+
--> $DIR/borrow_box.rs:20:14
33
|
44
LL | let foo: &Box<bool>;
55
| ^^^^^^^^^^ help: try: `&bool`
@@ -11,55 +11,55 @@ LL | #![deny(clippy::borrowed_box)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

1313
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
14-
--> $DIR/borrow_box.rs:25:10
14+
--> $DIR/borrow_box.rs:24:10
1515
|
1616
LL | foo: &'a Box<bool>,
1717
| ^^^^^^^^^^^^^ help: try: `&'a bool`
1818

1919
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
20-
--> $DIR/borrow_box.rs:29:17
20+
--> $DIR/borrow_box.rs:28:17
2121
|
2222
LL | fn test4(a: &Box<bool>);
2323
| ^^^^^^^^^^ help: try: `&bool`
2424

2525
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
26-
--> $DIR/borrow_box.rs:95:25
26+
--> $DIR/borrow_box.rs:94:25
2727
|
2828
LL | pub fn test14(_display: &Box<dyn Display>) {}
2929
| ^^^^^^^^^^^^^^^^^ help: try: `&dyn Display`
3030

3131
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
32-
--> $DIR/borrow_box.rs:96:25
32+
--> $DIR/borrow_box.rs:95:25
3333
|
3434
LL | pub fn test15(_display: &Box<dyn Display + Send>) {}
3535
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)`
3636

3737
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
38-
--> $DIR/borrow_box.rs:97:29
38+
--> $DIR/borrow_box.rs:96:29
3939
|
4040
LL | pub fn test16<'a>(_display: &'a Box<dyn Display + 'a>) {}
4141
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a (dyn Display + 'a)`
4242

4343
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
44-
--> $DIR/borrow_box.rs:99:25
44+
--> $DIR/borrow_box.rs:98:25
4545
|
4646
LL | pub fn test17(_display: &Box<impl Display>) {}
4747
| ^^^^^^^^^^^^^^^^^^ help: try: `&impl Display`
4848

4949
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
50-
--> $DIR/borrow_box.rs:100:25
50+
--> $DIR/borrow_box.rs:99:25
5151
|
5252
LL | pub fn test18(_display: &Box<impl Display + Send>) {}
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(impl Display + Send)`
5454

5555
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
56-
--> $DIR/borrow_box.rs:101:29
56+
--> $DIR/borrow_box.rs:100:29
5757
|
5858
LL | pub fn test19<'a>(_display: &'a Box<impl Display + 'a>) {}
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a (impl Display + 'a)`
6060

6161
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
62-
--> $DIR/borrow_box.rs:106:25
62+
--> $DIR/borrow_box.rs:105:25
6363
|
6464
LL | pub fn test20(_display: &Box<(dyn Display + Send)>) {}
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)`

tests/ui/branches_sharing_code/shared_at_bottom.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![allow(dead_code, clippy::equatable_if_let)]
21
#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
2+
#![allow(dead_code)]
3+
#![allow(clippy::equatable_if_let, clippy::uninlined_format_args)]
34

45
// This tests the branches_sharing_code lint at the end of blocks
56

tests/ui/branches_sharing_code/shared_at_bottom.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: all if blocks contain the same code at the end
2-
--> $DIR/shared_at_bottom.rs:30:5
2+
--> $DIR/shared_at_bottom.rs:31:5
33
|
44
LL | / let result = false;
55
LL | | println!("Block end!");
@@ -8,7 +8,7 @@ LL | | };
88
| |_____^
99
|
1010
note: the lint level is defined here
11-
--> $DIR/shared_at_bottom.rs:2:36
11+
--> $DIR/shared_at_bottom.rs:1:36
1212
|
1313
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -22,7 +22,7 @@ LL ~ result;
2222
|
2323

2424
error: all if blocks contain the same code at the end
25-
--> $DIR/shared_at_bottom.rs:48:5
25+
--> $DIR/shared_at_bottom.rs:49:5
2626
|
2727
LL | / println!("Same end of block");
2828
LL | | }
@@ -35,7 +35,7 @@ LL + println!("Same end of block");
3535
|
3636

3737
error: all if blocks contain the same code at the end
38-
--> $DIR/shared_at_bottom.rs:65:5
38+
--> $DIR/shared_at_bottom.rs:66:5
3939
|
4040
LL | / println!(
4141
LL | | "I'm moveable because I know: `outer_scope_value`: '{}'",
@@ -54,7 +54,7 @@ LL + );
5454
|
5555

5656
error: all if blocks contain the same code at the end
57-
--> $DIR/shared_at_bottom.rs:77:9
57+
--> $DIR/shared_at_bottom.rs:78:9
5858
|
5959
LL | / println!("Hello World");
6060
LL | | }
@@ -67,7 +67,7 @@ LL + println!("Hello World");
6767
|
6868

6969
error: all if blocks contain the same code at the end
70-
--> $DIR/shared_at_bottom.rs:93:5
70+
--> $DIR/shared_at_bottom.rs:94:5
7171
|
7272
LL | / let later_used_value = "A string value";
7373
LL | | println!("{}", later_used_value);
@@ -84,7 +84,7 @@ LL + println!("{}", later_used_value);
8484
|
8585

8686
error: all if blocks contain the same code at the end
87-
--> $DIR/shared_at_bottom.rs:106:5
87+
--> $DIR/shared_at_bottom.rs:107:5
8888
|
8989
LL | / let simple_examples = "I now identify as a &str :)";
9090
LL | | println!("This is the new simple_example: {}", simple_examples);
@@ -100,7 +100,7 @@ LL + println!("This is the new simple_example: {}", simple_examples);
100100
|
101101

102102
error: all if blocks contain the same code at the end
103-
--> $DIR/shared_at_bottom.rs:171:5
103+
--> $DIR/shared_at_bottom.rs:172:5
104104
|
105105
LL | / x << 2
106106
LL | | };
@@ -114,7 +114,7 @@ LL ~ x << 2;
114114
|
115115

116116
error: all if blocks contain the same code at the end
117-
--> $DIR/shared_at_bottom.rs:178:5
117+
--> $DIR/shared_at_bottom.rs:179:5
118118
|
119119
LL | / x * 4
120120
LL | | }
@@ -128,7 +128,7 @@ LL + x * 4
128128
|
129129

130130
error: all if blocks contain the same code at the end
131-
--> $DIR/shared_at_bottom.rs:190:44
131+
--> $DIR/shared_at_bottom.rs:191:44
132132
|
133133
LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; }
134134
| ^^^^^^^^^^^

tests/ui/branches_sharing_code/shared_at_top.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#![allow(dead_code, clippy::mixed_read_write_in_expression)]
2-
#![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
1+
#![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
2+
#![allow(dead_code)]
3+
#![allow(clippy::mixed_read_write_in_expression, clippy::uninlined_format_args)]
34

45
// This tests the branches_sharing_code lint at the start of blocks
56

0 commit comments

Comments
 (0)