2023-11-17 04:10:50 -06:00
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:14:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-11-27 20:28:55 -06:00
|
|
|
= note: `-D clippy::infinite-loop` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::infinite_loop)]`
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn no_break() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:21:5
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | loop {
|
|
|
|
LL | |
|
|
|
|
... |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | fn all_inf() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:23:9
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | fn all_inf() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:25:13
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_____________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | fn all_inf() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:39:5
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-11-27 20:28:55 -06:00
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:52:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | | fn inner_fn() -> ! {
|
|
|
|
LL | | std::process::exit(0);
|
|
|
|
LL | | }
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn no_break_never_ret_noise() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:95:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | loop {
|
|
|
|
LL | | if cond {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn break_inner_but_not_outer_1(cond: bool) -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:106:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | 'inner: loop {
|
|
|
|
LL | | loop {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn break_inner_but_not_outer_2(cond: bool) -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:120:9
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn break_outer_but_not_inner() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:143:9
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | 'inner: loop {
|
|
|
|
LL | | loop {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn break_wrong_loop(cond: bool) -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:183:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | match opt {
|
|
|
|
LL | | Some(v) => {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn match_like() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:224:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | let _x = matches!(result, Ok(v) if v != 0).then_some(0);
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn match_like() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:229:5
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | // This `return` does not return the function, so it doesn't count
|
|
|
|
LL | | let _x = matches!(result, Ok(v) if v != 0).then(|| {
|
|
|
|
... |
|
|
|
|
LL | | });
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-17 04:10:50 -06:00
|
|
|
|
|
|
|
|
LL | fn match_like() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
2023-11-21 02:18:18 -06:00
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:334:9
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | fn problematic_trait_method() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:344:9
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | fn could_be_problematic() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:353:9
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | do_something();
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2023-12-22 17:44:20 -06:00
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
2023-11-21 02:18:18 -06:00
|
|
|
|
|
|
|
|
LL | let _loop_forever = || -> ! {
|
|
|
|
| ++++
|
|
|
|
|
2023-11-27 20:28:55 -06:00
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:367:8
|
2023-11-27 20:28:55 -06:00
|
|
|
|
|
|
|
|
LL | Ok(loop {
|
|
|
|
| ________^
|
|
|
|
LL | | do_something()
|
|
|
|
LL | | })
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
|
|
|
2024-10-06 10:38:36 -05:00
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:409:5
|
2024-10-06 10:38:36 -05:00
|
|
|
|
|
|
|
|
LL | / 'infinite: loop {
|
|
|
|
LL | |
|
|
|
|
LL | | loop {
|
|
|
|
LL | | continue 'infinite;
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:416:5
|
2024-10-06 10:38:36 -05:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | 'inner: loop {
|
|
|
|
LL | | loop {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:418:9
|
2024-10-06 10:38:36 -05:00
|
|
|
|
|
|
|
|
LL | / 'inner: loop {
|
|
|
|
LL | | loop {
|
|
|
|
LL | | continue 'inner;
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: infinite loop detected
|
2024-10-26 12:18:02 -05:00
|
|
|
--> tests/ui/infinite_loops.rs:426:5
|
2024-10-06 10:38:36 -05:00
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
LL | |
|
|
|
|
LL | | continue;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
|
|
| ++++
|
|
|
|
|
|
|
|
error: aborting due to 21 previous errors
|
2023-12-22 18:02:22 -06:00
|
|
|
|