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