2017-02-17 04:53:14 +01:00
|
|
|
error: this loop never actually loops
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/never_loop.rs:12:5
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
2018-12-10 06:27:19 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | break;
|
|
|
|
|
LL | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2019-07-19 00:35:32 +02:00
|
|
|
= note: `#[deny(clippy::never_loop)]` on by default
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2024-02-27 15:25:18 +01:00
|
|
|
--> tests/ui/never_loop.rs:36:5
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
2025-02-11 17:57:08 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | break;
|
|
|
|
|
LL | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-17 04:53:14 +01:00
|
|
|
|
2017-05-31 23:22:15 -05:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:58:5
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
2018-12-10 06:27:19 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | return;
|
|
|
|
|
LL | | }
|
2017-12-07 11:20:48 +01:00
|
|
|
| |_____^
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:62:9
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / while i == 0 {
|
2025-02-11 17:57:08 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | }
|
2017-05-31 23:22:15 -05:00
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:76:9
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
2023-08-24 21:32:12 +02:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | continue 'outer;
|
|
|
|
|
LL | | }
|
2017-12-07 11:20:48 +01:00
|
|
|
| |_________^
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:114:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
|
LL | / while let Some(y) = x {
|
2025-02-11 17:57:08 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | }
|
|
|
|
|
| |_____^
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:123:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
|
LL | / for x in 0..10 {
|
2023-08-24 21:32:12 +02:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | }
|
|
|
|
|
| |_____^
|
2021-08-12 11:16:25 +02:00
|
|
|
|
|
|
|
|
|
help: if you need the first element of the iterator, try writing
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - for x in 0..10 {
|
|
|
|
|
LL + if let Some(x) = (0..10).next() {
|
|
|
|
|
|
|
2017-05-31 23:22:15 -05:00
|
|
|
|
2017-10-08 17:26:39 -05:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:173:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
|
LL | / 'outer: while a {
|
|
|
|
|
... |
|
|
|
|
|
LL | | break 'outer;
|
|
|
|
|
LL | | }
|
|
|
|
|
| |_____^
|
2017-10-08 17:26:39 -05:00
|
|
|
|
2017-11-05 14:43:28 +00:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:190:9
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
|
LL | / while false {
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | break 'label;
|
|
|
|
|
LL | | }
|
|
|
|
|
| |_________^
|
2017-11-05 14:43:28 +00:00
|
|
|
|
2022-10-06 09:44:38 +02:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:243:13
|
2022-10-06 09:44:38 +02:00
|
|
|
|
|
|
|
|
|
LL | let _ = loop {
|
|
|
|
|
| _____________^
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2022-10-06 09:44:38 +02:00
|
|
|
LL | | let Some(x) = x else {
|
2023-08-24 21:32:12 +02:00
|
|
|
... |
|
2022-10-06 09:44:38 +02:00
|
|
|
LL | | break x;
|
|
|
|
|
LL | | };
|
|
|
|
|
| |_____^
|
|
|
|
|
|
2022-11-21 20:34:47 +01:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:266:5
|
2022-11-21 20:34:47 +01:00
|
|
|
|
|
|
|
|
|
LL | / 'a: loop {
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2022-11-21 20:34:47 +01:00
|
|
|
LL | | 'b: {
|
2023-08-24 21:32:12 +02:00
|
|
|
... |
|
2022-11-21 20:34:47 +01:00
|
|
|
LL | | }
|
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-07-02 14:35:19 +02:00
|
|
|
error: sub-expression diverges
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:271:17
|
2023-07-02 14:35:19 +02:00
|
|
|
|
|
|
|
|
|
LL | break 'a;
|
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
|
|
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::diverging_sub_expression)]`
|
2023-07-02 14:35:19 +02:00
|
|
|
|
2023-02-25 19:08:29 -05:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:303:13
|
2023-02-25 19:08:29 -05:00
|
|
|
|
|
|
|
|
|
LL | / for _ in 0..20 {
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2023-02-25 19:08:29 -05:00
|
|
|
LL | | break 'block;
|
|
|
|
|
LL | | }
|
|
|
|
|
| |_____________^
|
|
|
|
|
|
|
|
|
|
|
help: if you need the first element of the iterator, try writing
|
|
|
|
|
|
|
2024-07-09 22:30:26 +00:00
|
|
|
LL - for _ in 0..20 {
|
|
|
|
|
LL + if let Some(_) = (0..20).next() {
|
|
|
|
|
|
|
2023-02-25 19:08:29 -05:00
|
|
|
|
2023-07-02 14:35:19 +02:00
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:388:13
|
2023-09-12 18:13:53 +02:00
|
|
|
|
|
|
|
|
|
LL | / 'c: loop {
|
|
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2023-09-12 18:13:53 +02:00
|
|
|
LL | | if b { break 'c } else { break 'b }
|
|
|
|
|
LL | | }
|
|
|
|
|
| |_____________^
|
|
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:400:5
|
2023-07-02 14:35:19 +02:00
|
|
|
|
|
|
|
|
|
LL | / loop {
|
2023-08-24 21:32:12 +02:00
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2023-09-12 18:13:53 +02:00
|
|
|
LL | | panic!("oh no");
|
|
|
|
|
LL | | }
|
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2025-02-12 23:44:38 +01:00
|
|
|
--> tests/ui/never_loop.rs:405:5
|
2023-09-12 18:13:53 +02:00
|
|
|
|
|
|
|
|
|
LL | / loop {
|
|
|
|
|
LL | |
|
2025-02-11 17:57:08 +01:00
|
|
|
LL | |
|
2023-09-12 18:13:53 +02:00
|
|
|
LL | | unimplemented!("not yet");
|
2023-07-02 14:35:19 +02:00
|
|
|
LL | | }
|
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-09-12 18:13:53 +02:00
|
|
|
error: aborting due to 16 previous errors
|
2018-01-16 17:06:27 +01:00
|
|
|
|