Skip to content

Commit bfd5aba

Browse files
committed
Fix all the other tests
1 parent 6e4c556 commit bfd5aba

File tree

63 files changed

+427
-355
lines changed

Some content is hidden

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

63 files changed

+427
-355
lines changed

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.fixed

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

45
fn main() {
56
let local_i32 = 1;

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.rs

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

45
fn main() {
56
let local_i32 = 1;

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: variables can be used directly in the `format!` string
2-
--> $DIR/uninlined_format_args.rs:9:5
2+
--> $DIR/uninlined_format_args.rs:10:5
33
|
44
LL | println!("val='{}'", local_i32);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL + println!("val='{local_i32}'");
1212
|
1313

1414
error: variables can be used directly in the `format!` string
15-
--> $DIR/uninlined_format_args.rs:10:5
15+
--> $DIR/uninlined_format_args.rs:11:5
1616
|
1717
LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -24,7 +24,7 @@ LL + println!("Hello {} is {local_f64:.local_i32$}", "x");
2424
|
2525

2626
error: literal with an empty format string
27-
--> $DIR/uninlined_format_args.rs:10:35
27+
--> $DIR/uninlined_format_args.rs:11:35
2828
|
2929
LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
3030
| ^^^
@@ -37,7 +37,7 @@ LL + println!("Hello x is {:.*}", local_i32, local_f64);
3737
|
3838

3939
error: variables can be used directly in the `format!` string
40-
--> $DIR/uninlined_format_args.rs:11:5
40+
--> $DIR/uninlined_format_args.rs:12:5
4141
|
4242
LL | println!("Hello {} is {:.*}", local_i32, 5, local_f64);
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
4949
|
5050

5151
error: variables can be used directly in the `format!` string
52-
--> $DIR/uninlined_format_args.rs:12:5
52+
--> $DIR/uninlined_format_args.rs:13:5
5353
|
5454
LL | println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
6161
|
6262

6363
error: variables can be used directly in the `format!` string
64-
--> $DIR/uninlined_format_args.rs:13:5
64+
--> $DIR/uninlined_format_args.rs:14:5
6565
|
6666
LL | println!("{}, {}", local_i32, local_opt.unwrap());
6767
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::arithmetic_side_effects)]
2+
#![allow(clippy::unnecessary_literal_unwrap)]
23

34
use core::ops::{Add, Neg};
45

tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
error: arithmetic operation that can potentially result in unexpected side-effects
2-
--> $DIR/arithmetic_side_effects_allowed.rs:68:13
2+
--> $DIR/arithmetic_side_effects_allowed.rs:69:13
33
|
44
LL | let _ = Baz + Baz;
55
| ^^^^^^^^^
66
|
77
= note: `-D clippy::arithmetic-side-effects` implied by `-D warnings`
88

99
error: arithmetic operation that can potentially result in unexpected side-effects
10-
--> $DIR/arithmetic_side_effects_allowed.rs:79:13
10+
--> $DIR/arithmetic_side_effects_allowed.rs:80:13
1111
|
1212
LL | let _ = 1i32 + Baz;
1313
| ^^^^^^^^^^
1414

1515
error: arithmetic operation that can potentially result in unexpected side-effects
16-
--> $DIR/arithmetic_side_effects_allowed.rs:82:13
16+
--> $DIR/arithmetic_side_effects_allowed.rs:83:13
1717
|
1818
LL | let _ = 1i64 + Foo;
1919
| ^^^^^^^^^^
2020

2121
error: arithmetic operation that can potentially result in unexpected side-effects
22-
--> $DIR/arithmetic_side_effects_allowed.rs:86:13
22+
--> $DIR/arithmetic_side_effects_allowed.rs:87:13
2323
|
2424
LL | let _ = 1i64 + Baz;
2525
| ^^^^^^^^^^
2626

2727
error: arithmetic operation that can potentially result in unexpected side-effects
28-
--> $DIR/arithmetic_side_effects_allowed.rs:97:13
28+
--> $DIR/arithmetic_side_effects_allowed.rs:98:13
2929
|
3030
LL | let _ = Baz + 1i32;
3131
| ^^^^^^^^^^
3232

3333
error: arithmetic operation that can potentially result in unexpected side-effects
34-
--> $DIR/arithmetic_side_effects_allowed.rs:100:13
34+
--> $DIR/arithmetic_side_effects_allowed.rs:101:13
3535
|
3636
LL | let _ = Foo + 1i64;
3737
| ^^^^^^^^^^
3838

3939
error: arithmetic operation that can potentially result in unexpected side-effects
40-
--> $DIR/arithmetic_side_effects_allowed.rs:104:13
40+
--> $DIR/arithmetic_side_effects_allowed.rs:105:13
4141
|
4242
LL | let _ = Baz + 1i64;
4343
| ^^^^^^^^^^
4444

4545
error: arithmetic operation that can potentially result in unexpected side-effects
46-
--> $DIR/arithmetic_side_effects_allowed.rs:113:13
46+
--> $DIR/arithmetic_side_effects_allowed.rs:114:13
4747
|
4848
LL | let _ = -Bar;
4949
| ^^^^
5050

5151
error: arithmetic operation that can potentially result in unexpected side-effects
52-
--> $DIR/arithmetic_side_effects_allowed.rs:115:13
52+
--> $DIR/arithmetic_side_effects_allowed.rs:116:13
5353
|
5454
LL | let _ = -Baz;
5555
| ^^^^

tests/ui-toml/expect_used/expect_used.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@compile-flags: --test
22
#![warn(clippy::expect_used)]
3+
#![allow(clippy::unnecessary_literal_unwrap)]
34

45
fn expect_option() {
56
let opt = Some(0);

tests/ui-toml/expect_used/expect_used.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: used `expect()` on an `Option` value
2-
--> $DIR/expect_used.rs:6:13
2+
--> $DIR/expect_used.rs:7:13
33
|
44
LL | let _ = opt.expect("");
55
| ^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | let _ = opt.expect("");
88
= note: `-D clippy::expect-used` implied by `-D warnings`
99

1010
error: used `expect()` on a `Result` value
11-
--> $DIR/expect_used.rs:11:13
11+
--> $DIR/expect_used.rs:12:13
1212
|
1313
LL | let _ = res.expect("");
1414
| ^^^^^^^^^^^^^^

tests/ui/assertions_on_result_states.fixed

Lines changed: 1 addition & 0 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::unnecessary_literal_unwrap)]
34

45
use std::result::Result;
56

tests/ui/assertions_on_result_states.rs

Lines changed: 1 addition & 0 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::unnecessary_literal_unwrap)]
34

45
use std::result::Result;
56

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();`

0 commit comments

Comments
 (0)