Skip to content

Commit 657caa5

Browse files
committed
update clippy
1 parent 99f2977 commit 657caa5

File tree

71 files changed

+961
-906
lines changed

Some content is hidden

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

71 files changed

+961
-906
lines changed

src/tools/clippy/tests/ui/assign_ops2.stderr

+18-18
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ LL | a += a + 1;
88
help: did you mean `a = a + 1` or `a = a + a + 1`? Consider replacing it with
99
|
1010
LL | a += 1;
11-
| ^^^^^^
11+
| ~~~~~~
1212
help: or
1313
|
1414
LL | a = a + a + 1;
15-
| ^^^^^^^^^^^^^
15+
| ~~~~~~~~~~~~~
1616

1717
error: variable appears on both sides of an assignment operation
1818
--> $DIR/assign_ops2.rs:6:5
@@ -23,11 +23,11 @@ LL | a += 1 + a;
2323
help: did you mean `a = a + 1` or `a = a + 1 + a`? Consider replacing it with
2424
|
2525
LL | a += 1;
26-
| ^^^^^^
26+
| ~~~~~~
2727
help: or
2828
|
2929
LL | a = a + 1 + a;
30-
| ^^^^^^^^^^^^^
30+
| ~~~~~~~~~~~~~
3131

3232
error: variable appears on both sides of an assignment operation
3333
--> $DIR/assign_ops2.rs:7:5
@@ -38,11 +38,11 @@ LL | a -= a - 1;
3838
help: did you mean `a = a - 1` or `a = a - (a - 1)`? Consider replacing it with
3939
|
4040
LL | a -= 1;
41-
| ^^^^^^
41+
| ~~~~~~
4242
help: or
4343
|
4444
LL | a = a - (a - 1);
45-
| ^^^^^^^^^^^^^^^
45+
| ~~~~~~~~~~~~~~~
4646

4747
error: variable appears on both sides of an assignment operation
4848
--> $DIR/assign_ops2.rs:8:5
@@ -53,11 +53,11 @@ LL | a *= a * 99;
5353
help: did you mean `a = a * 99` or `a = a * a * 99`? Consider replacing it with
5454
|
5555
LL | a *= 99;
56-
| ^^^^^^^
56+
| ~~~~~~~
5757
help: or
5858
|
5959
LL | a = a * a * 99;
60-
| ^^^^^^^^^^^^^^
60+
| ~~~~~~~~~~~~~~
6161

6262
error: variable appears on both sides of an assignment operation
6363
--> $DIR/assign_ops2.rs:9:5
@@ -68,11 +68,11 @@ LL | a *= 42 * a;
6868
help: did you mean `a = a * 42` or `a = a * 42 * a`? Consider replacing it with
6969
|
7070
LL | a *= 42;
71-
| ^^^^^^^
71+
| ~~~~~~~
7272
help: or
7373
|
7474
LL | a = a * 42 * a;
75-
| ^^^^^^^^^^^^^^
75+
| ~~~~~~~~~~~~~~
7676

7777
error: variable appears on both sides of an assignment operation
7878
--> $DIR/assign_ops2.rs:10:5
@@ -83,11 +83,11 @@ LL | a /= a / 2;
8383
help: did you mean `a = a / 2` or `a = a / (a / 2)`? Consider replacing it with
8484
|
8585
LL | a /= 2;
86-
| ^^^^^^
86+
| ~~~~~~
8787
help: or
8888
|
8989
LL | a = a / (a / 2);
90-
| ^^^^^^^^^^^^^^^
90+
| ~~~~~~~~~~~~~~~
9191

9292
error: variable appears on both sides of an assignment operation
9393
--> $DIR/assign_ops2.rs:11:5
@@ -98,11 +98,11 @@ LL | a %= a % 5;
9898
help: did you mean `a = a % 5` or `a = a % (a % 5)`? Consider replacing it with
9999
|
100100
LL | a %= 5;
101-
| ^^^^^^
101+
| ~~~~~~
102102
help: or
103103
|
104104
LL | a = a % (a % 5);
105-
| ^^^^^^^^^^^^^^^
105+
| ~~~~~~~~~~~~~~~
106106

107107
error: variable appears on both sides of an assignment operation
108108
--> $DIR/assign_ops2.rs:12:5
@@ -113,11 +113,11 @@ LL | a &= a & 1;
113113
help: did you mean `a = a & 1` or `a = a & a & 1`? Consider replacing it with
114114
|
115115
LL | a &= 1;
116-
| ^^^^^^
116+
| ~~~~~~
117117
help: or
118118
|
119119
LL | a = a & a & 1;
120-
| ^^^^^^^^^^^^^
120+
| ~~~~~~~~~~~~~
121121

122122
error: variable appears on both sides of an assignment operation
123123
--> $DIR/assign_ops2.rs:13:5
@@ -128,11 +128,11 @@ LL | a *= a * a;
128128
help: did you mean `a = a * a` or `a = a * a * a`? Consider replacing it with
129129
|
130130
LL | a *= a;
131-
| ^^^^^^
131+
| ~~~~~~
132132
help: or
133133
|
134134
LL | a = a * a * a;
135-
| ^^^^^^^^^^^^^
135+
| ~~~~~~~~~~~~~
136136

137137
error: manual implementation of an assign operation
138138
--> $DIR/assign_ops2.rs:50:5

src/tools/clippy/tests/ui/async_yields_async.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ LL | | };
1414
= note: `-D clippy::async-yields-async` implied by `-D warnings`
1515
help: consider awaiting this value
1616
|
17-
LL | async {
18-
LL | 3
19-
LL | }.await
17+
LL ~ async {
18+
LL + 3
19+
LL + }.await
2020
|
2121

2222
error: an async construct yields a type which is itself awaitable
@@ -47,9 +47,9 @@ LL | | };
4747
|
4848
help: consider awaiting this value
4949
|
50-
LL | async {
51-
LL | 3
52-
LL | }.await
50+
LL ~ async {
51+
LL + 3
52+
LL + }.await
5353
|
5454

5555
error: an async construct yields a type which is itself awaitable

src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | #![deny(clippy::bind_instead_of_map)]
1212
help: try this
1313
|
1414
LL | let _ = Some("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
15-
| ^^^ ^ ^^^^^^^
15+
| ~~~ ~ ~~~~~~~
1616

1717
error: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
1818
--> $DIR/bind_instead_of_map_multipart.rs:8:13
@@ -23,7 +23,7 @@ LL | let _ = Ok::<_, ()>("42").and_then(|s| if s.len() < 42 { Ok(0) } else {
2323
help: try this
2424
|
2525
LL | let _ = Ok::<_, ()>("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
26-
| ^^^ ^ ^^^^^^^
26+
| ~~~ ~ ~~~~~~~
2727

2828
error: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
2929
--> $DIR/bind_instead_of_map_multipart.rs:11:13
@@ -34,7 +34,7 @@ LL | let _ = Err::<(), _>("42").or_else(|s| if s.len() < 42 { Err(s.len() +
3434
help: try this
3535
|
3636
LL | let _ = Err::<(), _>("42").map_err(|s| if s.len() < 42 { s.len() + 20 } else { s.len() });
37-
| ^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^
37+
| ~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~
3838

3939
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
4040
--> $DIR/bind_instead_of_map_multipart.rs:19:5
@@ -50,10 +50,10 @@ LL | | });
5050
|
5151
help: try this
5252
|
53-
LL | Some("42").map(|s| {
53+
LL ~ Some("42").map(|s| {
5454
LL | if {
5555
LL | if s == "43" {
56-
LL | return 43;
56+
LL ~ return 43;
5757
LL | }
5858
LL | s == "42"
5959
...
@@ -67,7 +67,7 @@ LL | let _ = Some("").and_then(|s| if s.len() == 20 { Some(m!()) } else { So
6767
help: try this
6868
|
6969
LL | let _ = Some("").map(|s| if s.len() == 20 { m!() } else { Some(20) });
70-
| ^^^ ^^^^ ^^^^^^^^
70+
| ~~~ ~~~~ ~~~~~~~~
7171

7272
error: aborting due to 5 previous errors
7373

src/tools/clippy/tests/ui/blocks_in_if_conditions.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ LL | | } {
1010
= note: `-D clippy::blocks-in-if-conditions` implied by `-D warnings`
1111
help: try
1212
|
13-
LL | let res = {
14-
LL | let x = 3;
15-
LL | x == 3
16-
LL | }; if res {
13+
LL ~ let res = {
14+
LL + let x = 3;
15+
LL + x == 3
16+
LL ~ }; if res {
1717
|
1818

1919
error: omit braces around single expression condition

src/tools/clippy/tests/ui/branches_sharing_code/shared_at_bottom.stderr

+25-25
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
1515
= note: The end suggestion probably needs some adjustments to use the expression result correctly
1616
help: consider moving the end statements out like this
1717
|
18-
LL | }
19-
LL | let result = false;
20-
LL | println!("Block end!");
21-
LL | result;
18+
LL ~ }
19+
LL + let result = false;
20+
LL + println!("Block end!");
21+
LL ~ result;
2222
|
2323

2424
error: all if blocks contain the same code at the end
@@ -30,8 +30,8 @@ LL | | }
3030
|
3131
help: consider moving the end statements out like this
3232
|
33-
LL | }
34-
LL | println!("Same end of block");
33+
LL ~ }
34+
LL + println!("Same end of block");
3535
|
3636

3737
error: all if blocks contain the same code at the end
@@ -46,11 +46,11 @@ LL | | }
4646
|
4747
help: consider moving the end statements out like this
4848
|
49-
LL | }
50-
LL | println!(
51-
LL | "I'm moveable because I know: `outer_scope_value`: '{}'",
52-
LL | outer_scope_value
53-
LL | );
49+
LL ~ }
50+
LL + println!(
51+
LL + "I'm moveable because I know: `outer_scope_value`: '{}'",
52+
LL + outer_scope_value
53+
LL + );
5454
|
5555

5656
error: all if blocks contain the same code at the end
@@ -62,8 +62,8 @@ LL | | }
6262
|
6363
help: consider moving the end statements out like this
6464
|
65-
LL | }
66-
LL | println!("Hello World");
65+
LL ~ }
66+
LL + println!("Hello World");
6767
|
6868

6969
error: all if blocks contain the same code at the end
@@ -78,9 +78,9 @@ LL | | }
7878
= warning: Some moved values might need to be renamed to avoid wrong references
7979
help: consider moving the end statements out like this
8080
|
81-
LL | }
82-
LL | let later_used_value = "A string value";
83-
LL | println!("{}", later_used_value);
81+
LL ~ }
82+
LL + let later_used_value = "A string value";
83+
LL + println!("{}", later_used_value);
8484
|
8585

8686
error: all if blocks contain the same code at the end
@@ -94,9 +94,9 @@ LL | | }
9494
= warning: Some moved values might need to be renamed to avoid wrong references
9595
help: consider moving the end statements out like this
9696
|
97-
LL | }
98-
LL | let simple_examples = "I now identify as a &str :)";
99-
LL | println!("This is the new simple_example: {}", simple_examples);
97+
LL ~ }
98+
LL + let simple_examples = "I now identify as a &str :)";
99+
LL + println!("This is the new simple_example: {}", simple_examples);
100100
|
101101

102102
error: all if blocks contain the same code at the end
@@ -109,8 +109,8 @@ LL | | };
109109
= note: The end suggestion probably needs some adjustments to use the expression result correctly
110110
help: consider moving the end statements out like this
111111
|
112-
LL | }
113-
LL | x << 2;
112+
LL ~ }
113+
LL ~ x << 2;
114114
|
115115

116116
error: all if blocks contain the same code at the end
@@ -123,8 +123,8 @@ LL | | }
123123
= note: The end suggestion probably needs some adjustments to use the expression result correctly
124124
help: consider moving the end statements out like this
125125
|
126-
LL | }
127-
LL | x * 4
126+
LL ~ }
127+
LL + x * 4
128128
|
129129

130130
error: all if blocks contain the same code at the end
@@ -135,8 +135,8 @@ LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; }
135135
|
136136
help: consider moving the end statements out like this
137137
|
138-
LL | if x == 17 { b = 1; a = 0x99; } else { }
139-
LL | a = 0x99;
138+
LL ~ if x == 17 { b = 1; a = 0x99; } else { }
139+
LL + a = 0x99;
140140
|
141141

142142
error: aborting due to 9 previous errors

0 commit comments

Comments
 (0)