Skip to content

fix typo in infinite loop lint #11999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/loops/infinite_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(super) fn check<'tcx>(
if let FnRetTy::DefaultReturn(ret_span) = parent_fn_ret {
diag.span_suggestion(
ret_span,
"if this is intentional, consider specifing `!` as function return",
"if this is intentional, consider specifying `!` as function return",
" -> !",
Applicability::MaybeIncorrect,
);
Expand Down
30 changes: 15 additions & 15 deletions tests/ui/infinite_loops.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LL | | }
|
= note: `-D clippy::infinite-loop` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::infinite_loop)]`
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn no_break() -> ! {
| ++++
Expand All @@ -26,7 +26,7 @@ LL | | do_something();
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn all_inf() -> ! {
| ++++
Expand All @@ -43,7 +43,7 @@ LL | | }
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn all_inf() -> ! {
| ++++
Expand All @@ -57,7 +57,7 @@ LL | | do_something();
LL | | }
| |_____________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn all_inf() -> ! {
| ++++
Expand All @@ -84,7 +84,7 @@ LL | | do_something();
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn no_break_never_ret_noise() -> ! {
| ++++
Expand All @@ -101,7 +101,7 @@ LL | | }
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn break_inner_but_not_outer_1(cond: bool) -> ! {
| ++++
Expand All @@ -118,7 +118,7 @@ LL | | }
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn break_inner_but_not_outer_2(cond: bool) -> ! {
| ++++
Expand All @@ -132,7 +132,7 @@ LL | | do_something();
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn break_outer_but_not_inner() -> ! {
| ++++
Expand All @@ -149,7 +149,7 @@ LL | | }
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn break_wrong_loop(cond: bool) -> ! {
| ++++
Expand All @@ -166,7 +166,7 @@ LL | | }
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn match_like() -> ! {
| ++++
Expand All @@ -180,7 +180,7 @@ LL | | let _x = matches!(result, Ok(v) if v != 0).then_some(0);
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn match_like() -> ! {
| ++++
Expand All @@ -197,7 +197,7 @@ LL | | });
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn match_like() -> ! {
| ++++
Expand All @@ -211,7 +211,7 @@ LL | | do_something();
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn problematic_trait_method() -> ! {
| ++++
Expand All @@ -225,7 +225,7 @@ LL | | do_something();
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | fn could_be_problematic() -> ! {
| ++++
Expand All @@ -239,7 +239,7 @@ LL | | do_something();
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
help: if this is intentional, consider specifying `!` as function return
|
LL | let _loop_forever = || -> ! {
| ++++
Expand Down