Skip to content

Commit eb39702

Browse files
committed
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 changelog: none
1 parent f8ba192 commit eb39702

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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 10 additions & 10 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

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-
--> $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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 10 additions & 10 deletions
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)`

0 commit comments

Comments
 (0)