Skip to content

Commit e66eeba

Browse files
committed
rv 1
1 parent 6d7a773 commit e66eeba

8 files changed

+27
-29
lines changed

tests/ui/assertions_on_result_states.fixed

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

54
use std::result::Result;
65

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

4847
// test ok that shouldn't be moved
4948
let r: Result<CopyFoo, DebugFoo> = Ok(CopyFoo);
50-
fn test_ref_unmovable_ok(r: &Result<CopyFoo, DebugFoo>) {
49+
fn test_ref_unmoveable_ok(r: &Result<CopyFoo, DebugFoo>) {
5150
assert!(r.is_ok());
5251
}
53-
test_ref_unmovable_ok(&r);
52+
test_ref_unmoveable_ok(&r);
5453
assert!(r.is_ok());
5554
r.unwrap();
5655

tests/ui/assertions_on_result_states.rs

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

54
use std::result::Result;
65

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

4847
// test ok that shouldn't be moved
4948
let r: Result<CopyFoo, DebugFoo> = Ok(CopyFoo);
50-
fn test_ref_unmovable_ok(r: &Result<CopyFoo, DebugFoo>) {
49+
fn test_ref_unmoveable_ok(r: &Result<CopyFoo, DebugFoo>) {
5150
assert!(r.is_ok());
5251
}
53-
test_ref_unmovable_ok(&r);
52+
test_ref_unmoveable_ok(&r);
5453
assert!(r.is_ok());
5554
r.unwrap();
5655

tests/ui/assertions_on_result_states.stderr

+7-7
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:25:5
2+
--> $DIR/assertions_on_result_states.rs:24: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:43:5
10+
--> $DIR/assertions_on_result_states.rs:42: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:46:5
16+
--> $DIR/assertions_on_result_states.rs:45: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:59:5
22+
--> $DIR/assertions_on_result_states.rs:58: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:65:9
28+
--> $DIR/assertions_on_result_states.rs:64: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:73:5
34+
--> $DIR/assertions_on_result_states.rs:72: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:83:5
40+
--> $DIR/assertions_on_result_states.rs:82:5
4141
|
4242
LL | assert!(res.is_err())
4343
| ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `res.unwrap_err();`

tests/ui/branches_sharing_code/shared_at_bottom.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ fn simple_examples() {
1212
let start_value = 0;
1313
println!("=^.^=");
1414

15-
// Same but not movable due to `start_value`
15+
// Same but not moveable due to `start_value`
1616
let _ = start_value;
1717

18-
// The rest is self contained and movable => Only lint the rest
18+
// The rest is self contained and moveable => Only lint the rest
1919
let result = false;
2020
println!("Block end!");
2121
result
@@ -24,10 +24,10 @@ fn simple_examples() {
2424
let start_value = 8;
2525
println!("xD");
2626

27-
// Same but not movable due to `start_value`
27+
// Same but not moveable due to `start_value`
2828
let _ = start_value;
2929

30-
// The rest is self contained and movable => Only lint the rest
30+
// The rest is self contained and moveable => Only lint the rest
3131
let result = false;
3232
println!("Block end!");
3333
result
@@ -56,15 +56,15 @@ fn simple_examples() {
5656
println!("I'm a local because I use the value `z`: `{}`", z);
5757

5858
println!(
59-
"I'm movable because I know: `outer_scope_value`: '{}'",
59+
"I'm moveable because I know: `outer_scope_value`: '{}'",
6060
outer_scope_value
6161
);
6262
} else {
6363
let z = 45678000;
6464
println!("I'm a local because I use the value `z`: `{}`", z);
6565

6666
println!(
67-
"I'm movable because I know: `outer_scope_value`: '{}'",
67+
"I'm moveable because I know: `outer_scope_value`: '{}'",
6868
outer_scope_value
6969
);
7070
}
@@ -111,7 +111,7 @@ fn simple_but_suggestion_is_invalid() {
111111
}
112112

113113
/// Tests where the blocks are not linted due to the used value scope
114-
fn not_movable_due_to_value_scope() {
114+
fn not_moveable_due_to_value_scope() {
115115
let x = 18;
116116

117117
// Using a local value in the moved code

tests/ui/branches_sharing_code/shared_at_bottom.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ error: all if blocks contain the same code at the end
3838
--> $DIR/shared_at_bottom.rs:66:5
3939
|
4040
LL | / println!(
41-
LL | | "I'm movable because I know: `outer_scope_value`: '{}'",
41+
LL | | "I'm moveable because I know: `outer_scope_value`: '{}'",
4242
LL | | outer_scope_value
4343
LL | | );
4444
LL | | }
@@ -48,7 +48,7 @@ help: consider moving these statements after the if
4848
|
4949
LL ~ }
5050
LL + println!(
51-
LL + "I'm movable because I know: `outer_scope_value`: '{}'",
51+
LL + "I'm moveable because I know: `outer_scope_value`: '{}'",
5252
LL + outer_scope_value
5353
LL + );
5454
|

tests/ui/branches_sharing_code/shared_at_top.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ fn simple_but_suggestion_is_invalid() {
7272
let _ = can_be_overridden;
7373
if x == 11 {
7474
let can_be_overridden = "Move me";
75-
println!("I'm also movable");
75+
println!("I'm also moveable");
7676
let _ = 111;
7777
} else {
7878
let can_be_overridden = "Move me";
79-
println!("I'm also movable");
79+
println!("I'm also moveable");
8080
let _ = 222;
8181
}
8282
}

tests/ui/branches_sharing_code/shared_at_top.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ error: all if blocks contain the same code at the start
6868
|
6969
LL | / if x == 11 {
7070
LL | | let can_be_overridden = "Move me";
71-
LL | | println!("I'm also movable");
72-
| |_____________________________________^
71+
LL | | println!("I'm also moveable");
72+
| |______________________________________^
7373
|
7474
= warning: some moved values might need to be renamed to avoid wrong references
7575
help: consider moving these statements before the if
7676
|
7777
LL ~ let can_be_overridden = "Move me";
78-
LL + println!("I'm also movable");
78+
LL + println!("I'm also moveable");
7979
LL + if x == 11 {
8080
|
8181

tests/ui/empty_line_after_outer_attribute.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// aux-build:proc_macro_attr.rs
2+
#![warn(clippy::empty_line_after_outer_attr)]
3+
#![allow(clippy::assertions_on_constants)]
24
#![feature(custom_inner_attributes)]
35
#![rustfmt::skip]
4-
#![warn(clippy::empty_line_after_outer_attr)]
5-
#![allow(clippy::assertions_on_constants, clippy::uninlined_format_args)]
66

77
#[macro_use]
88
extern crate proc_macro_attr;

0 commit comments

Comments
 (0)