diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2021-05-12 21:41:59 -0400 |
|---|---|---|
| committer | Jason Newcomb <jsnewcomb@pm.me> | 2021-05-12 21:51:23 -0400 |
| commit | cd0db8a4599619dd43af5f39834a7566d06e5b50 (patch) | |
| tree | 1288a393b2ce3c8e79d5c9ed7c295ca7a4fd8ee3 | |
| parent | 4713e25ab07badc863fff05fcd5bcf9852cf375e (diff) | |
| download | rust-cd0db8a4599619dd43af5f39834a7566d06e5b50.tar.gz rust-cd0db8a4599619dd43af5f39834a7566d06e5b50.zip | |
Fix test comment for `while_let_on_iterator`
| -rw-r--r-- | tests/ui/while_let_on_iterator.fixed | 6 | ||||
| -rw-r--r-- | tests/ui/while_let_on_iterator.rs | 6 | ||||
| -rw-r--r-- | tests/ui/while_let_on_iterator.stderr | 22 |
3 files changed, 15 insertions, 19 deletions
diff --git a/tests/ui/while_let_on_iterator.fixed b/tests/ui/while_let_on_iterator.fixed index 389297eff0c..c3e2cf0c4a4 100644 --- a/tests/ui/while_let_on_iterator.fixed +++ b/tests/ui/while_let_on_iterator.fixed @@ -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); diff --git a/tests/ui/while_let_on_iterator.rs b/tests/ui/while_let_on_iterator.rs index df932724a0d..1717006a449 100644 --- a/tests/ui/while_let_on_iterator.rs +++ b/tests/ui/while_let_on_iterator.rs @@ -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); diff --git a/tests/ui/while_let_on_iterator.stderr b/tests/ui/while_let_on_iterator.stderr index e8741f74981..eff559bef7e 100644 --- a/tests/ui/while_let_on_iterator.stderr +++ b/tests/ui/while_let_on_iterator.stderr @@ -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` |
