Skip to content

Commit 67a33e8

Browse files
committed
fix typo in infinite loop lint
1 parent e0b25c5 commit 67a33e8

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

clippy_lints/src/loops/infinite_loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(super) fn check<'tcx>(
4949
if let FnRetTy::DefaultReturn(ret_span) = parent_fn_ret {
5050
diag.span_suggestion(
5151
ret_span,
52-
"if this is intentional, consider specifing `!` as function return",
52+
"if this is intentional, consider specifying `!` as function return",
5353
" -> !",
5454
Applicability::MaybeIncorrect,
5555
);

tests/ui/infinite_loops.stderr

+15-16
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | | }
99
|
1010
= note: `-D clippy::infinite-loop` implied by `-D warnings`
1111
= help: to override `-D warnings` add `#[allow(clippy::infinite_loop)]`
12-
help: if this is intentional, consider specifing `!` as function return
12+
help: if this is intentional, consider specifying `!` as function return
1313
|
1414
LL | fn no_break() -> ! {
1515
| ++++
@@ -26,7 +26,7 @@ LL | | do_something();
2626
LL | | }
2727
| |_____^
2828
|
29-
help: if this is intentional, consider specifing `!` as function return
29+
help: if this is intentional, consider specifying `!` as function return
3030
|
3131
LL | fn all_inf() -> ! {
3232
| ++++
@@ -43,7 +43,7 @@ LL | | }
4343
LL | | }
4444
| |_________^
4545
|
46-
help: if this is intentional, consider specifing `!` as function return
46+
help: if this is intentional, consider specifying `!` as function return
4747
|
4848
LL | fn all_inf() -> ! {
4949
| ++++
@@ -57,7 +57,7 @@ LL | | do_something();
5757
LL | | }
5858
| |_____________^
5959
|
60-
help: if this is intentional, consider specifing `!` as function return
60+
help: if this is intentional, consider specifying `!` as function return
6161
|
6262
LL | fn all_inf() -> ! {
6363
| ++++
@@ -84,7 +84,7 @@ LL | | do_something();
8484
LL | | }
8585
| |_____^
8686
|
87-
help: if this is intentional, consider specifing `!` as function return
87+
help: if this is intentional, consider specifying `!` as function return
8888
|
8989
LL | fn no_break_never_ret_noise() -> ! {
9090
| ++++
@@ -101,7 +101,7 @@ LL | | }
101101
LL | | }
102102
| |_____^
103103
|
104-
help: if this is intentional, consider specifing `!` as function return
104+
help: if this is intentional, consider specifying `!` as function return
105105
|
106106
LL | fn break_inner_but_not_outer_1(cond: bool) -> ! {
107107
| ++++
@@ -118,7 +118,7 @@ LL | | }
118118
LL | | }
119119
| |_____^
120120
|
121-
help: if this is intentional, consider specifing `!` as function return
121+
help: if this is intentional, consider specifying `!` as function return
122122
|
123123
LL | fn break_inner_but_not_outer_2(cond: bool) -> ! {
124124
| ++++
@@ -132,7 +132,7 @@ LL | | do_something();
132132
LL | | }
133133
| |_________^
134134
|
135-
help: if this is intentional, consider specifing `!` as function return
135+
help: if this is intentional, consider specifying `!` as function return
136136
|
137137
LL | fn break_outer_but_not_inner() -> ! {
138138
| ++++
@@ -149,7 +149,7 @@ LL | | }
149149
LL | | }
150150
| |_________^
151151
|
152-
help: if this is intentional, consider specifing `!` as function return
152+
help: if this is intentional, consider specifying `!` as function return
153153
|
154154
LL | fn break_wrong_loop(cond: bool) -> ! {
155155
| ++++
@@ -166,7 +166,7 @@ LL | | }
166166
LL | | }
167167
| |_____^
168168
|
169-
help: if this is intentional, consider specifing `!` as function return
169+
help: if this is intentional, consider specifying `!` as function return
170170
|
171171
LL | fn match_like() -> ! {
172172
| ++++
@@ -180,7 +180,7 @@ LL | | let _x = matches!(result, Ok(v) if v != 0).then_some(0);
180180
LL | | }
181181
| |_____^
182182
|
183-
help: if this is intentional, consider specifing `!` as function return
183+
help: if this is intentional, consider specifying `!` as function return
184184
|
185185
LL | fn match_like() -> ! {
186186
| ++++
@@ -197,7 +197,7 @@ LL | | });
197197
LL | | }
198198
| |_____^
199199
|
200-
help: if this is intentional, consider specifing `!` as function return
200+
help: if this is intentional, consider specifying `!` as function return
201201
|
202202
LL | fn match_like() -> ! {
203203
| ++++
@@ -211,7 +211,7 @@ LL | | do_something();
211211
LL | | }
212212
| |_________^
213213
|
214-
help: if this is intentional, consider specifing `!` as function return
214+
help: if this is intentional, consider specifying `!` as function return
215215
|
216216
LL | fn problematic_trait_method() -> ! {
217217
| ++++
@@ -225,7 +225,7 @@ LL | | do_something();
225225
LL | | }
226226
| |_________^
227227
|
228-
help: if this is intentional, consider specifing `!` as function return
228+
help: if this is intentional, consider specifying `!` as function return
229229
|
230230
LL | fn could_be_problematic() -> ! {
231231
| ++++
@@ -239,7 +239,7 @@ LL | | do_something();
239239
LL | | }
240240
| |_________^
241241
|
242-
help: if this is intentional, consider specifing `!` as function return
242+
help: if this is intentional, consider specifying `!` as function return
243243
|
244244
LL | let _loop_forever = || -> ! {
245245
| ++++
@@ -256,4 +256,3 @@ LL | | })
256256
= help: if this is not intended, try adding a `break` or `return` condition in the loop
257257

258258
error: aborting due to 17 previous errors
259-

0 commit comments

Comments
 (0)