Skip to content

Commit a04e819

Browse files
Trim suggestion part before generating highlights
1 parent fef0ea9 commit a04e819

6 files changed

+20
-24
lines changed

tests/ui/async_yields_async.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ LL | | };
1414
= help: to override `-D warnings` add `#[allow(clippy::async_yields_async)]`
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
@@ -46,9 +46,9 @@ LL | | };
4646
|
4747
help: consider awaiting this value
4848
|
49-
LL ~ async {
50-
LL + 3
51-
LL + }.await
49+
LL | async {
50+
LL | 3
51+
LL ~ }.await
5252
|
5353

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

tests/ui/fn_to_numeric_cast_any.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ LL | f as usize
152152
help: did you mean to invoke the function?
153153
|
154154
LL | f() as usize
155-
|
155+
| ++
156156

157157
error: casting function pointer `T::static_method` to `usize`
158158
--> tests/ui/fn_to_numeric_cast_any.rs:62:5
@@ -163,7 +163,7 @@ LL | T::static_method as usize
163163
help: did you mean to invoke the function?
164164
|
165165
LL | T::static_method() as usize
166-
|
166+
| ++
167167

168168
error: casting function pointer `(clos as fn(u32) -> u32)` to `usize`
169169
--> tests/ui/fn_to_numeric_cast_any.rs:69:13

tests/ui/implicit_return.stderr

+6-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | true
99
help: add `return` as shown
1010
|
1111
LL | return true
12-
|
12+
| ++++++
1313

1414
error: missing `return` statement
1515
--> tests/ui/implicit_return.rs:19:15
@@ -122,7 +122,7 @@ LL | format!("test {}", "test")
122122
help: add `return` as shown
123123
|
124124
LL | return format!("test {}", "test")
125-
|
125+
| ++++++
126126

127127
error: missing `return` statement
128128
--> tests/ui/implicit_return.rs:90:5
@@ -133,7 +133,7 @@ LL | m!(true, false)
133133
help: add `return` as shown
134134
|
135135
LL | return m!(true, false)
136-
|
136+
| ++++++
137137

138138
error: missing `return` statement
139139
--> tests/ui/implicit_return.rs:96:13
@@ -169,10 +169,8 @@ LL | | }
169169
|
170170
help: add `return` as shown
171171
|
172-
LL ~ return loop {
173-
LL + m!(true);
174-
LL + }
175-
|
172+
LL | return loop {
173+
| ++++++
176174

177175
error: missing `return` statement
178176
--> tests/ui/implicit_return.rs:130:5
@@ -183,7 +181,7 @@ LL | true
183181
help: add `return` as shown
184182
|
185183
LL | return true
186-
|
184+
| ++++++
187185

188186
error: aborting due to 16 previous errors
189187

tests/ui/manual_flatten.stderr

+3-5
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ LL | | }
196196
| |_________^
197197
help: try
198198
|
199-
LL ~ for n in vec![
200-
LL +
201-
LL + Some(1),
202-
LL + Some(2),
203-
LL + Some(3)
199+
LL | for n in vec![
200+
...
201+
LL | Some(3)
204202
LL ~ ].iter().flatten() {
205203
|
206204

tests/ui/too_long_first_doc_paragraph-fix.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | | /// 200 characters so I needed to write something longeeeeeeer.
1212
= help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
1313
help: add an empty line
1414
|
15-
LL ~ /// A very short summary.
15+
LL | /// A very short summary.
1616
LL + ///
1717
|
1818

tests/ui/too_long_first_doc_paragraph.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ LL | | //! 200 characters so I needed to write something longeeeeeeer.
1212
= help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
1313
help: add an empty line
1414
|
15-
LL ~ //! A very short summary.
16-
LL + //!
15+
LL | //! A very short summary.
16+
LL ~ //!
1717
LL ~ //! A much longer explanation that goes into a lot more detail about
1818
|
1919

0 commit comments

Comments
 (0)