]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/while_loop.stderr
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / while_loop.stderr
CommitLineData
ea8adc8c
XL
1error: this loop could be written as a `while let` loop
2 --> $DIR/while_loop.rs:9:5
3 |
49 | / loop {
510 | | if let Some(_x) = y {
611 | | let _v = 1;
712 | | } else {
813 | | break
914 | | }
1015 | | }
11 | |_____^ help: try: `while let Some(_x) = y { .. }`
12 |
13 = note: `-D while-let-loop` implied by `-D warnings`
14
15error: this loop could be written as a `while let` loop
16 --> $DIR/while_loop.rs:22:5
17 |
1822 | / loop {
1923 | | match y {
2024 | | Some(_x) => true,
2125 | | None => break
2226 | | };
2327 | | }
24 | |_____^ help: try: `while let Some(_x) = y { .. }`
25
26error: this loop could be written as a `while let` loop
27 --> $DIR/while_loop.rs:28:5
28 |
2928 | / loop {
3029 | | let x = match y {
3130 | | Some(x) => x,
3231 | | None => break
33... |
3434 | | let _str = "foo";
3535 | | }
36 | |_____^ help: try: `while let Some(x) = y { .. }`
37
38error: this loop could be written as a `while let` loop
39 --> $DIR/while_loop.rs:36:5
40 |
4136 | / loop {
4237 | | let x = match y {
4338 | | Some(x) => x,
4439 | | None => break,
45... |
4642 | | { let _b = "foobar"; }
4743 | | }
48 | |_____^ help: try: `while let Some(x) = y { .. }`
49
50error: this loop could be written as a `while let` loop
51 --> $DIR/while_loop.rs:58:5
52 |
5358 | / loop {
5459 | | let (e, l) = match "".split_whitespace().next() {
5560 | | Some(word) => (word.is_empty(), word.len()),
5661 | | None => break
57... |
5864 | | let _ = (e, l);
5965 | | }
60 | |_____^ help: try: `while let Some(word) = "".split_whitespace().next() { .. }`
61
62error: this loop could be written as a `for` loop
63 --> $DIR/while_loop.rs:68:5
64 |
6568 | / while let Option::Some(x) = iter.next() {
6669 | | println!("{}", x);
6770 | | }
68 | |_____^ help: try: `for x in iter { .. }`
69 |
70 = note: `-D while-let-on-iterator` implied by `-D warnings`
71
72error: this loop could be written as a `for` loop
73 --> $DIR/while_loop.rs:73:5
74 |
7573 | / while let Some(x) = iter.next() {
7674 | | println!("{}", x);
7775 | | }
78 | |_____^ help: try: `for x in iter { .. }`
79
80error: this loop could be written as a `for` loop
81 --> $DIR/while_loop.rs:78:5
82 |
8378 | while let Some(_) = iter.next() {}
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in iter { .. }`
85
86error: this loop could be written as a `while let` loop
87 --> $DIR/while_loop.rs:118:5
88 |
89118 | / loop {
90119 | | let _ = match iter.next() {
91120 | | Some(ele) => ele,
92121 | | None => break
93122 | | };
94123 | | loop {}
95124 | | }
96 | |_____^ help: try: `while let Some(ele) = iter.next() { .. }`
97
98error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
99 --> $DIR/while_loop.rs:123:9
100 |
101123 | loop {}
102 | ^^^^^^^
103 |
104 = note: `-D empty-loop` implied by `-D warnings`
105
106error: this loop could be written as a `for` loop
107 --> $DIR/while_loop.rs:183:9
108 |
109183 | / while let Some(v) = y.next() { // use a for loop here
110184 | | }
111 | |_________^ help: try: `for v in y { .. }`
112