|
| 1 | +error: this `.skip()` call skips more items than the iterator will produce |
| 2 | + --> $DIR/iter_out_of_bounds.rs:11:14 |
| 3 | + | |
| 4 | +LL | for _ in [1, 2, 3].iter().skip(4) { |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: this operation is useless and will create an empty iterator |
| 8 | +note: the lint level is defined here |
| 9 | + --> $DIR/iter_out_of_bounds.rs:3:9 |
| 10 | + | |
| 11 | +LL | #![deny(clippy::iter_out_of_bounds)] |
| 12 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 13 | + |
| 14 | +error: this `.take()` call takes more items than the iterator will produce |
| 15 | + --> $DIR/iter_out_of_bounds.rs:15:19 |
| 16 | + | |
| 17 | +LL | for (i, _) in [1, 2, 3].iter().take(4).enumerate() { |
| 18 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 19 | + | |
| 20 | + = note: this operation is useless and the returned iterator will simply yield the same items |
| 21 | + |
| 22 | +error: this `.take()` call takes more items than the iterator will produce |
| 23 | + --> $DIR/iter_out_of_bounds.rs:21:14 |
| 24 | + | |
| 25 | +LL | for _ in (&&&&&&[1, 2, 3]).iter().take(4) {} |
| 26 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 27 | + | |
| 28 | + = note: this operation is useless and the returned iterator will simply yield the same items |
| 29 | + |
| 30 | +error: this `.skip()` call skips more items than the iterator will produce |
| 31 | + --> $DIR/iter_out_of_bounds.rs:24:14 |
| 32 | + | |
| 33 | +LL | for _ in [1, 2, 3].iter().skip(4) {} |
| 34 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 35 | + | |
| 36 | + = note: this operation is useless and will create an empty iterator |
| 37 | + |
| 38 | +error: this `.skip()` call skips more items than the iterator will produce |
| 39 | + --> $DIR/iter_out_of_bounds.rs:27:14 |
| 40 | + | |
| 41 | +LL | for _ in [1; 3].iter().skip(4) {} |
| 42 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 43 | + | |
| 44 | + = note: this operation is useless and will create an empty iterator |
| 45 | + |
| 46 | +error: this `.skip()` call skips more items than the iterator will produce |
| 47 | + --> $DIR/iter_out_of_bounds.rs:33:14 |
| 48 | + | |
| 49 | +LL | for _ in vec![1, 2, 3].iter().skip(4) {} |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 51 | + | |
| 52 | + = note: this operation is useless and will create an empty iterator |
| 53 | + |
| 54 | +error: this `.skip()` call skips more items than the iterator will produce |
| 55 | + --> $DIR/iter_out_of_bounds.rs:36:14 |
| 56 | + | |
| 57 | +LL | for _ in vec![1; 3].iter().skip(4) {} |
| 58 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 59 | + | |
| 60 | + = note: this operation is useless and will create an empty iterator |
| 61 | + |
| 62 | +error: this `.skip()` call skips more items than the iterator will produce |
| 63 | + --> $DIR/iter_out_of_bounds.rs:40:14 |
| 64 | + | |
| 65 | +LL | for _ in x.iter().skip(4) {} |
| 66 | + | ^^^^^^^^^^^^^^^^ |
| 67 | + | |
| 68 | + = note: this operation is useless and will create an empty iterator |
| 69 | + |
| 70 | +error: this `.skip()` call skips more items than the iterator will produce |
| 71 | + --> $DIR/iter_out_of_bounds.rs:44:14 |
| 72 | + | |
| 73 | +LL | for _ in x.iter().skip(n) {} |
| 74 | + | ^^^^^^^^^^^^^^^^ |
| 75 | + | |
| 76 | + = note: this operation is useless and will create an empty iterator |
| 77 | + |
| 78 | +error: this `.skip()` call skips more items than the iterator will produce |
| 79 | + --> $DIR/iter_out_of_bounds.rs:49:14 |
| 80 | + | |
| 81 | +LL | for _ in empty().skip(1) {} |
| 82 | + | ^^^^^^^^^^^^^^^ |
| 83 | + | |
| 84 | + = note: this operation is useless and will create an empty iterator |
| 85 | + |
| 86 | +error: this `.take()` call takes more items than the iterator will produce |
| 87 | + --> $DIR/iter_out_of_bounds.rs:52:14 |
| 88 | + | |
| 89 | +LL | for _ in empty().take(1) {} |
| 90 | + | ^^^^^^^^^^^^^^^ |
| 91 | + | |
| 92 | + = note: this operation is useless and the returned iterator will simply yield the same items |
| 93 | + |
| 94 | +error: this `.skip()` call skips more items than the iterator will produce |
| 95 | + --> $DIR/iter_out_of_bounds.rs:55:14 |
| 96 | + | |
| 97 | +LL | for _ in std::iter::once(1).skip(2) {} |
| 98 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 99 | + | |
| 100 | + = note: this operation is useless and will create an empty iterator |
| 101 | + |
| 102 | +error: this `.take()` call takes more items than the iterator will produce |
| 103 | + --> $DIR/iter_out_of_bounds.rs:58:14 |
| 104 | + | |
| 105 | +LL | for _ in std::iter::once(1).take(2) {} |
| 106 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 107 | + | |
| 108 | + = note: this operation is useless and the returned iterator will simply yield the same items |
| 109 | + |
| 110 | +error: this `.take()` call takes more items than the iterator will produce |
| 111 | + --> $DIR/iter_out_of_bounds.rs:61:14 |
| 112 | + | |
| 113 | +LL | for x in [].iter().take(1) { |
| 114 | + | ^^^^^^^^^^^^^^^^^ |
| 115 | + | |
| 116 | + = note: this operation is useless and the returned iterator will simply yield the same items |
| 117 | + |
| 118 | +error: aborting due to 14 previous errors |
| 119 | + |
0 commit comments