1
1
error: index out of bounds: the len is 4 but the index is 4
2
- --> $DIR/indexing_slicing.rs:19 :5
2
+ --> $DIR/indexing_slicing.rs:18 :5
3
3
|
4
4
LL | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
5
5
| ^^^^
6
6
|
7
7
= note: #[deny(const_err)] on by default
8
8
9
9
error: index out of bounds: the len is 4 but the index is 8
10
- --> $DIR/indexing_slicing.rs:20 :5
10
+ --> $DIR/indexing_slicing.rs:19 :5
11
11
|
12
12
LL | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
13
13
| ^^^^^^^^^
14
14
15
15
error: index out of bounds: the len is 4 but the index is 15
16
- --> $DIR/indexing_slicing.rs:55 :5
16
+ --> $DIR/indexing_slicing.rs:54 :5
17
17
|
18
18
LL | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
19
19
| ^^^^
20
20
21
21
error: indexing may panic.
22
- --> $DIR/indexing_slicing.rs:14 :5
22
+ --> $DIR/indexing_slicing.rs:13 :5
23
23
|
24
24
LL | x[index];
25
25
| ^^^^^^^^
@@ -28,181 +28,181 @@ LL | x[index];
28
28
= help: Consider using `.get(n)` or `.get_mut(n)` instead
29
29
30
30
error: slicing may panic.
31
- --> $DIR/indexing_slicing.rs:15 :6
31
+ --> $DIR/indexing_slicing.rs:14 :6
32
32
|
33
33
LL | &x[index..];
34
34
| ^^^^^^^^^^
35
35
|
36
36
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
37
37
38
38
error: slicing may panic.
39
- --> $DIR/indexing_slicing.rs:16 :6
39
+ --> $DIR/indexing_slicing.rs:15 :6
40
40
|
41
41
LL | &x[..index];
42
42
| ^^^^^^^^^^
43
43
|
44
44
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
45
45
46
46
error: slicing may panic.
47
- --> $DIR/indexing_slicing.rs:17 :6
47
+ --> $DIR/indexing_slicing.rs:16 :6
48
48
|
49
49
LL | &x[index_from..index_to];
50
50
| ^^^^^^^^^^^^^^^^^^^^^^^
51
51
|
52
52
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
53
53
54
54
error: slicing may panic.
55
- --> $DIR/indexing_slicing.rs:18 :6
55
+ --> $DIR/indexing_slicing.rs:17 :6
56
56
|
57
57
LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
58
58
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
59
|
60
60
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
61
61
62
62
error: slicing may panic.
63
- --> $DIR/indexing_slicing.rs:18 :6
63
+ --> $DIR/indexing_slicing.rs:17 :6
64
64
|
65
65
LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
66
66
| ^^^^^^^^^^^^^^^
67
67
|
68
68
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
69
69
70
70
error: slicing may panic.
71
- --> $DIR/indexing_slicing.rs:21 :6
71
+ --> $DIR/indexing_slicing.rs:20 :6
72
72
|
73
73
LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
74
74
| ^^^^^^^^^^^^
75
75
|
76
76
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
77
77
78
78
error: range is out of bounds
79
- --> $DIR/indexing_slicing.rs:21 :8
79
+ --> $DIR/indexing_slicing.rs:20 :8
80
80
|
81
81
LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
82
82
| ^
83
83
|
84
84
= note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
85
85
86
86
error: slicing may panic.
87
- --> $DIR/indexing_slicing.rs:22 :6
87
+ --> $DIR/indexing_slicing.rs:21 :6
88
88
|
89
89
LL | &x[0..][..3];
90
90
| ^^^^^^^^^^^
91
91
|
92
92
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
93
93
94
94
error: slicing may panic.
95
- --> $DIR/indexing_slicing.rs:23 :6
95
+ --> $DIR/indexing_slicing.rs:22 :6
96
96
|
97
97
LL | &x[1..][..5];
98
98
| ^^^^^^^^^^^
99
99
|
100
100
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
101
101
102
102
error: indexing may panic.
103
- --> $DIR/indexing_slicing.rs:31 :5
103
+ --> $DIR/indexing_slicing.rs:30 :5
104
104
|
105
105
LL | y[0];
106
106
| ^^^^
107
107
|
108
108
= help: Consider using `.get(n)` or `.get_mut(n)` instead
109
109
110
110
error: slicing may panic.
111
- --> $DIR/indexing_slicing.rs:32 :6
111
+ --> $DIR/indexing_slicing.rs:31 :6
112
112
|
113
113
LL | &y[1..2];
114
114
| ^^^^^^^
115
115
|
116
116
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
117
117
118
118
error: slicing may panic.
119
- --> $DIR/indexing_slicing.rs:33 :6
119
+ --> $DIR/indexing_slicing.rs:32 :6
120
120
|
121
121
LL | &y[0..=4];
122
122
| ^^^^^^^^
123
123
|
124
124
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
125
125
126
126
error: slicing may panic.
127
- --> $DIR/indexing_slicing.rs:34 :6
127
+ --> $DIR/indexing_slicing.rs:33 :6
128
128
|
129
129
LL | &y[..=4];
130
130
| ^^^^^^^
131
131
|
132
132
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
133
133
134
134
error: indexing may panic.
135
- --> $DIR/indexing_slicing.rs:39 :5
135
+ --> $DIR/indexing_slicing.rs:38 :5
136
136
|
137
137
LL | v[0];
138
138
| ^^^^
139
139
|
140
140
= help: Consider using `.get(n)` or `.get_mut(n)` instead
141
141
142
142
error: indexing may panic.
143
- --> $DIR/indexing_slicing.rs:40 :5
143
+ --> $DIR/indexing_slicing.rs:39 :5
144
144
|
145
145
LL | v[10];
146
146
| ^^^^^
147
147
|
148
148
= help: Consider using `.get(n)` or `.get_mut(n)` instead
149
149
150
150
error: indexing may panic.
151
- --> $DIR/indexing_slicing.rs:41 :5
151
+ --> $DIR/indexing_slicing.rs:40 :5
152
152
|
153
153
LL | v[1 << 3];
154
154
| ^^^^^^^^^
155
155
|
156
156
= help: Consider using `.get(n)` or `.get_mut(n)` instead
157
157
158
158
error: slicing may panic.
159
- --> $DIR/indexing_slicing.rs:42 :6
159
+ --> $DIR/indexing_slicing.rs:41 :6
160
160
|
161
161
LL | &v[10..100];
162
162
| ^^^^^^^^^^
163
163
|
164
164
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
165
165
166
166
error: slicing may panic.
167
- --> $DIR/indexing_slicing.rs:43 :6
167
+ --> $DIR/indexing_slicing.rs:42 :6
168
168
|
169
169
LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
170
170
| ^^^^^^^^^^^^^^
171
171
|
172
172
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
173
173
174
174
error: range is out of bounds
175
- --> $DIR/indexing_slicing.rs:43 :8
175
+ --> $DIR/indexing_slicing.rs:42 :8
176
176
|
177
177
LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
178
178
| ^^
179
179
180
180
error: slicing may panic.
181
- --> $DIR/indexing_slicing.rs:44 :6
181
+ --> $DIR/indexing_slicing.rs:43 :6
182
182
|
183
183
LL | &v[10..];
184
184
| ^^^^^^^
185
185
|
186
186
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
187
187
188
188
error: slicing may panic.
189
- --> $DIR/indexing_slicing.rs:45 :6
189
+ --> $DIR/indexing_slicing.rs:44 :6
190
190
|
191
191
LL | &v[..100];
192
192
| ^^^^^^^^
193
193
|
194
194
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
195
195
196
196
error: indexing may panic.
197
- --> $DIR/indexing_slicing.rs:57 :5
197
+ --> $DIR/indexing_slicing.rs:56 :5
198
198
|
199
199
LL | v[N];
200
200
| ^^^^
201
201
|
202
202
= help: Consider using `.get(n)` or `.get_mut(n)` instead
203
203
204
204
error: indexing may panic.
205
- --> $DIR/indexing_slicing.rs:58 :5
205
+ --> $DIR/indexing_slicing.rs:57 :5
206
206
|
207
207
LL | v[M];
208
208
| ^^^^
0 commit comments