Fix test comment for while_let_on_iterator

This commit is contained in:
Jason Newcomb 2021-05-12 21:41:59 -04:00
parent 4713e25ab0
commit cd0db8a459
No known key found for this signature in database
GPG key ID: DA59E8643A37ED06
3 changed files with 15 additions and 19 deletions

View file

@ -148,10 +148,8 @@ fn issue1121() {
}
fn issue2965() {
// This should not cause an ICE and suggest:
//
// for _ in values.iter() {}
//
// This should not cause an ICE
use std::collections::HashSet;
let mut values = HashSet::new();
values.insert(1);

View file

@ -148,10 +148,8 @@ fn issue1121() {
}
fn issue2965() {
// This should not cause an ICE and suggest:
//
// for _ in values.iter() {}
//
// This should not cause an ICE
use std::collections::HashSet;
let mut values = HashSet::new();
values.insert(1);

View file

@ -43,49 +43,49 @@ LL | while let Some(_) = y.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in y`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:193:9
--> $DIR/while_let_on_iterator.rs:191:9
|
LL | while let Some(m) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in &mut it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:204:5
--> $DIR/while_let_on_iterator.rs:202:5
|
LL | while let Some(n) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for n in it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:206:9
--> $DIR/while_let_on_iterator.rs:204:9
|
LL | while let Some(m) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:215:9
--> $DIR/while_let_on_iterator.rs:213:9
|
LL | while let Some(m) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:224:9
--> $DIR/while_let_on_iterator.rs:222:9
|
LL | while let Some(m) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in &mut it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:241:9
--> $DIR/while_let_on_iterator.rs:239:9
|
LL | while let Some(m) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in &mut it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:256:13
--> $DIR/while_let_on_iterator.rs:254:13
|
LL | while let Some(i) = self.0.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for i in &mut self.0`
error: manual `!RangeInclusive::contains` implementation
--> $DIR/while_let_on_iterator.rs:257:20
--> $DIR/while_let_on_iterator.rs:255:20
|
LL | if i < 3 || i > 7 {
| ^^^^^^^^^^^^^^ help: use: `!(3..=7).contains(&i)`
@ -93,19 +93,19 @@ LL | if i < 3 || i > 7 {
= note: `-D clippy::manual-range-contains` implied by `-D warnings`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:288:13
--> $DIR/while_let_on_iterator.rs:286:13
|
LL | while let Some(i) = self.0.0.0.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for i in &mut self.0.0.0`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:317:5
--> $DIR/while_let_on_iterator.rs:315:5
|
LL | while let Some(n) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for n in &mut it`
error: this loop could be written as a `for` loop
--> $DIR/while_let_on_iterator.rs:327:5
--> $DIR/while_let_on_iterator.rs:325:5
|
LL | while let Some(..) = it.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in it`