]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/for_loops_over_fallibles.stderr
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / tools / clippy / tests / ui / for_loops_over_fallibles.stderr
CommitLineData
f20569fa
XL
1error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement
2 --> $DIR/for_loops_over_fallibles.rs:9:14
3 |
4LL | for x in option {
5 | ^^^^^^
6 |
7 = note: `-D clippy::for-loops-over-fallibles` implied by `-D warnings`
8 = help: consider replacing `for x in option` with `if let Some(x) = option`
9
10error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement
11 --> $DIR/for_loops_over_fallibles.rs:14:14
12 |
13LL | for x in result {
14 | ^^^^^^
15 |
16 = help: consider replacing `for x in result` with `if let Ok(x) = result`
17
18error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement
19 --> $DIR/for_loops_over_fallibles.rs:18:14
20 |
21LL | for x in option.ok_or("x not found") {
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 |
24 = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
25
26error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
27 --> $DIR/for_loops_over_fallibles.rs:24:14
28 |
29LL | for x in v.iter().next() {
30 | ^^^^^^^^^^^^^^^
31 |
32 = note: `#[deny(clippy::iter_next_loop)]` on by default
33
34error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement
35 --> $DIR/for_loops_over_fallibles.rs:29:14
36 |
37LL | for x in v.iter().next().and(Some(0)) {
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39 |
40 = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
41
42error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement
43 --> $DIR/for_loops_over_fallibles.rs:33:14
44 |
45LL | for x in v.iter().next().ok_or("x not found") {
46 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 |
48 = help: consider replacing `for x in v.iter().next().ok_or("x not found")` with `if let Ok(x) = v.iter().next().ok_or("x not found")`
49
50error: this loop never actually loops
51 --> $DIR/for_loops_over_fallibles.rs:45:5
52 |
53LL | / while let Some(x) = option {
54LL | | println!("{}", x);
55LL | | break;
56LL | | }
57 | |_____^
58 |
59 = note: `#[deny(clippy::never_loop)]` on by default
60
61error: this loop never actually loops
62 --> $DIR/for_loops_over_fallibles.rs:51:5
63 |
64LL | / while let Ok(x) = result {
65LL | | println!("{}", x);
66LL | | break;
67LL | | }
68 | |_____^
69
70error: aborting due to 8 previous errors
71