Skip to content

Commit e9c5723

Browse files
committed
Fix test comment for while_let_on_iterator
1 parent b208a80 commit e9c5723

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

tests/ui/while_let_on_iterator.fixed

+2-4
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ fn issue1121() {
148148
}
149149

150150
fn issue2965() {
151-
// This should not cause an ICE and suggest:
152-
//
153-
// for _ in values.iter() {}
154-
//
151+
// This should not cause an ICE
152+
155153
use std::collections::HashSet;
156154
let mut values = HashSet::new();
157155
values.insert(1);

tests/ui/while_let_on_iterator.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ fn issue1121() {
148148
}
149149

150150
fn issue2965() {
151-
// This should not cause an ICE and suggest:
152-
//
153-
// for _ in values.iter() {}
154-
//
151+
// This should not cause an ICE
152+
155153
use std::collections::HashSet;
156154
let mut values = HashSet::new();
157155
values.insert(1);

tests/ui/while_let_on_iterator.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -43,69 +43,69 @@ LL | while let Some(_) = y.next() {
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in y`
4444

4545
error: this loop could be written as a `for` loop
46-
--> $DIR/while_let_on_iterator.rs:193:9
46+
--> $DIR/while_let_on_iterator.rs:191:9
4747
|
4848
LL | while let Some(m) = it.next() {
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in &mut it`
5050

5151
error: this loop could be written as a `for` loop
52-
--> $DIR/while_let_on_iterator.rs:204:5
52+
--> $DIR/while_let_on_iterator.rs:202:5
5353
|
5454
LL | while let Some(n) = it.next() {
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for n in it`
5656

5757
error: this loop could be written as a `for` loop
58-
--> $DIR/while_let_on_iterator.rs:206:9
58+
--> $DIR/while_let_on_iterator.rs:204:9
5959
|
6060
LL | while let Some(m) = it.next() {
6161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it`
6262

6363
error: this loop could be written as a `for` loop
64-
--> $DIR/while_let_on_iterator.rs:215:9
64+
--> $DIR/while_let_on_iterator.rs:213:9
6565
|
6666
LL | while let Some(m) = it.next() {
6767
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it`
6868

6969
error: this loop could be written as a `for` loop
70-
--> $DIR/while_let_on_iterator.rs:224:9
70+
--> $DIR/while_let_on_iterator.rs:222:9
7171
|
7272
LL | while let Some(m) = it.next() {
7373
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in &mut it`
7474

7575
error: this loop could be written as a `for` loop
76-
--> $DIR/while_let_on_iterator.rs:241:9
76+
--> $DIR/while_let_on_iterator.rs:239:9
7777
|
7878
LL | while let Some(m) = it.next() {
7979
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in &mut it`
8080

8181
error: this loop could be written as a `for` loop
82-
--> $DIR/while_let_on_iterator.rs:256:13
82+
--> $DIR/while_let_on_iterator.rs:254:13
8383
|
8484
LL | while let Some(i) = self.0.next() {
8585
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for i in &mut self.0`
8686

8787
error: manual `!RangeInclusive::contains` implementation
88-
--> $DIR/while_let_on_iterator.rs:257:20
88+
--> $DIR/while_let_on_iterator.rs:255:20
8989
|
9090
LL | if i < 3 || i > 7 {
9191
| ^^^^^^^^^^^^^^ help: use: `!(3..=7).contains(&i)`
9292
|
9393
= note: `-D clippy::manual-range-contains` implied by `-D warnings`
9494

9595
error: this loop could be written as a `for` loop
96-
--> $DIR/while_let_on_iterator.rs:288:13
96+
--> $DIR/while_let_on_iterator.rs:286:13
9797
|
9898
LL | while let Some(i) = self.0.0.0.next() {
9999
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for i in &mut self.0.0.0`
100100

101101
error: this loop could be written as a `for` loop
102-
--> $DIR/while_let_on_iterator.rs:317:5
102+
--> $DIR/while_let_on_iterator.rs:315:5
103103
|
104104
LL | while let Some(n) = it.next() {
105105
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for n in &mut it`
106106

107107
error: this loop could be written as a `for` loop
108-
--> $DIR/while_let_on_iterator.rs:327:5
108+
--> $DIR/while_let_on_iterator.rs:325:5
109109
|
110110
LL | while let Some(..) = it.next() {
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in it`

0 commit comments

Comments
 (0)