Skip to content

Commit 6d7a773

Browse files
committed
fallout: allow new uninlined_format_args in tests
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: * 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 * minor spelling rename - "moveable" -> "movable"
1 parent 68408c5 commit 6d7a773

File tree

185 files changed

+1045
-1012
lines changed

Some content is hidden

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

185 files changed

+1045
-1012
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/assertions_on_result_states.fixed

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::assertions_on_result_states)]
3+
#![allow(clippy::uninlined_format_args)]
34

45
use std::result::Result;
56

@@ -46,10 +47,10 @@ fn main() {
4647

4748
// test ok that shouldn't be moved
4849
let r: Result<CopyFoo, DebugFoo> = Ok(CopyFoo);
49-
fn test_ref_unmoveable_ok(r: &Result<CopyFoo, DebugFoo>) {
50+
fn test_ref_unmovable_ok(r: &Result<CopyFoo, DebugFoo>) {
5051
assert!(r.is_ok());
5152
}
52-
test_ref_unmoveable_ok(&r);
53+
test_ref_unmovable_ok(&r);
5354
assert!(r.is_ok());
5455
r.unwrap();
5556

tests/ui/assertions_on_result_states.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::assertions_on_result_states)]
3+
#![allow(clippy::uninlined_format_args)]
34

45
use std::result::Result;
56

@@ -46,10 +47,10 @@ fn main() {
4647

4748
// test ok that shouldn't be moved
4849
let r: Result<CopyFoo, DebugFoo> = Ok(CopyFoo);
49-
fn test_ref_unmoveable_ok(r: &Result<CopyFoo, DebugFoo>) {
50+
fn test_ref_unmovable_ok(r: &Result<CopyFoo, DebugFoo>) {
5051
assert!(r.is_ok());
5152
}
52-
test_ref_unmoveable_ok(&r);
53+
test_ref_unmovable_ok(&r);
5354
assert!(r.is_ok());
5455
r.unwrap();
5556

tests/ui/assertions_on_result_states.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error: called `assert!` with `Result::is_ok`
2-
--> $DIR/assertions_on_result_states.rs:24:5
2+
--> $DIR/assertions_on_result_states.rs:25:5
33
|
44
LL | assert!(r.is_ok());
55
| ^^^^^^^^^^^^^^^^^^ help: replace with: `r.unwrap()`
66
|
77
= note: `-D clippy::assertions-on-result-states` implied by `-D warnings`
88

99
error: called `assert!` with `Result::is_ok`
10-
--> $DIR/assertions_on_result_states.rs:42:5
10+
--> $DIR/assertions_on_result_states.rs:43:5
1111
|
1212
LL | assert!(get_ok().is_ok());
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `get_ok().unwrap()`
1414

1515
error: called `assert!` with `Result::is_ok`
16-
--> $DIR/assertions_on_result_states.rs:45:5
16+
--> $DIR/assertions_on_result_states.rs:46:5
1717
|
1818
LL | assert!(get_ok_macro!().is_ok());
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `get_ok_macro!().unwrap()`
2020

2121
error: called `assert!` with `Result::is_ok`
22-
--> $DIR/assertions_on_result_states.rs:58:5
22+
--> $DIR/assertions_on_result_states.rs:59:5
2323
|
2424
LL | assert!(r.is_ok());
2525
| ^^^^^^^^^^^^^^^^^^ help: replace with: `r.unwrap()`
2626

2727
error: called `assert!` with `Result::is_ok`
28-
--> $DIR/assertions_on_result_states.rs:64:9
28+
--> $DIR/assertions_on_result_states.rs:65:9
2929
|
3030
LL | assert!(r.is_ok());
3131
| ^^^^^^^^^^^^^^^^^^ help: replace with: `r.unwrap()`
3232

3333
error: called `assert!` with `Result::is_err`
34-
--> $DIR/assertions_on_result_states.rs:72:5
34+
--> $DIR/assertions_on_result_states.rs:73:5
3535
|
3636
LL | assert!(r.is_err());
3737
| ^^^^^^^^^^^^^^^^^^^ help: replace with: `r.unwrap_err()`
3838

3939
error: called `assert!` with `Result::is_err`
40-
--> $DIR/assertions_on_result_states.rs:82:5
40+
--> $DIR/assertions_on_result_states.rs:83:5
4141
|
4242
LL | assert!(res.is_err())
4343
| ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `res.unwrap_err();`

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() {

0 commit comments

Comments
 (0)