Skip to content

Commit fc532c5

Browse files
compiler-errorsworkingjubilee
authored andcommitted
Trim suggestion parts to the subset that is purely additive
1 parent ef7aa51 commit fc532c5

File tree

2 files changed

+18
-29
lines changed

2 files changed

+18
-29
lines changed

tests/ui/implicit_return.stderr

+16-26
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ LL | true
88
= help: to override `-D warnings` add `#[allow(clippy::implicit_return)]`
99
help: add `return` as shown
1010
|
11-
LL - true
12-
LL + return true
11+
LL | return true
1312
|
1413

1514
error: missing `return` statement
@@ -20,9 +19,8 @@ LL | if true { true } else { false }
2019
|
2120
help: add `return` as shown
2221
|
23-
LL - if true { true } else { false }
24-
LL + if true { return true } else { false }
25-
|
22+
LL | if true { return true } else { false }
23+
| ++++++
2624

2725
error: missing `return` statement
2826
--> tests/ui/implicit_return.rs:19:29
@@ -32,9 +30,8 @@ LL | if true { true } else { false }
3230
|
3331
help: add `return` as shown
3432
|
35-
LL - if true { true } else { false }
36-
LL + if true { true } else { return false }
37-
|
33+
LL | if true { true } else { return false }
34+
| ++++++
3835

3936
error: missing `return` statement
4037
--> tests/ui/implicit_return.rs:25:17
@@ -44,9 +41,8 @@ LL | true => false,
4441
|
4542
help: add `return` as shown
4643
|
47-
LL - true => false,
48-
LL + true => return false,
49-
|
44+
LL | true => return false,
45+
| ++++++
5046

5147
error: missing `return` statement
5248
--> tests/ui/implicit_return.rs:26:20
@@ -56,9 +52,8 @@ LL | false => { true },
5652
|
5753
help: add `return` as shown
5854
|
59-
LL - false => { true },
60-
LL + false => { return true },
61-
|
55+
LL | false => { return true },
56+
| ++++++
6257

6358
error: missing `return` statement
6459
--> tests/ui/implicit_return.rs:39:9
@@ -104,9 +99,8 @@ LL | let _ = || { true };
10499
|
105100
help: add `return` as shown
106101
|
107-
LL - let _ = || { true };
108-
LL + let _ = || { return true };
109-
|
102+
LL | let _ = || { return true };
103+
| ++++++
110104

111105
error: missing `return` statement
112106
--> tests/ui/implicit_return.rs:73:16
@@ -116,9 +110,8 @@ LL | let _ = || true;
116110
|
117111
help: add `return` as shown
118112
|
119-
LL - let _ = || true;
120-
LL + let _ = || return true;
121-
|
113+
LL | let _ = || return true;
114+
| ++++++
122115

123116
error: missing `return` statement
124117
--> tests/ui/implicit_return.rs:81:5
@@ -128,8 +121,7 @@ LL | format!("test {}", "test")
128121
|
129122
help: add `return` as shown
130123
|
131-
LL - format!("test {}", "test")
132-
LL + return format!("test {}", "test")
124+
LL | return format!("test {}", "test")
133125
|
134126

135127
error: missing `return` statement
@@ -140,8 +132,7 @@ LL | m!(true, false)
140132
|
141133
help: add `return` as shown
142134
|
143-
LL - m!(true, false)
144-
LL + return m!(true, false)
135+
LL | return m!(true, false)
145136
|
146137

147138
error: missing `return` statement
@@ -191,8 +182,7 @@ LL | true
191182
|
192183
help: add `return` as shown
193184
|
194-
LL - true
195-
LL + return true
185+
LL | return true
196186
|
197187

198188
error: aborting due to 16 previous errors

tests/ui/legacy_numeric_constants.stderr

+2-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ LL | MAX;
6868
|
6969
help: use the associated constant instead
7070
|
71-
LL - MAX;
72-
LL + u32::MAX;
73-
|
71+
LL | u32::MAX;
72+
| +++++
7473

7574
error: usage of a legacy numeric method
7675
--> tests/ui/legacy_numeric_constants.rs:49:10

0 commit comments

Comments
 (0)