11error: 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
33 |
44LL | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
55 | ^^^^
66 |
77 = note: #[deny(const_err)] on by default
88
99error: 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
1111 |
1212LL | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
1313 | ^^^^^^^^^
1414
1515error: 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
1717 |
1818LL | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
1919 | ^^^^
2020
2121error: indexing may panic.
22- --> $DIR/indexing_slicing.rs:14 :5
22+ --> $DIR/indexing_slicing.rs:13 :5
2323 |
2424LL | x[index];
2525 | ^^^^^^^^
@@ -28,181 +28,181 @@ LL | x[index];
2828 = help: Consider using `.get(n)` or `.get_mut(n)` instead
2929
3030error: slicing may panic.
31- --> $DIR/indexing_slicing.rs:15 :6
31+ --> $DIR/indexing_slicing.rs:14 :6
3232 |
3333LL | &x[index..];
3434 | ^^^^^^^^^^
3535 |
3636 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
3737
3838error: slicing may panic.
39- --> $DIR/indexing_slicing.rs:16 :6
39+ --> $DIR/indexing_slicing.rs:15 :6
4040 |
4141LL | &x[..index];
4242 | ^^^^^^^^^^
4343 |
4444 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
4545
4646error: slicing may panic.
47- --> $DIR/indexing_slicing.rs:17 :6
47+ --> $DIR/indexing_slicing.rs:16 :6
4848 |
4949LL | &x[index_from..index_to];
5050 | ^^^^^^^^^^^^^^^^^^^^^^^
5151 |
5252 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
5353
5454error: slicing may panic.
55- --> $DIR/indexing_slicing.rs:18 :6
55+ --> $DIR/indexing_slicing.rs:17 :6
5656 |
5757LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
5858 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
5959 |
6060 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
6161
6262error: slicing may panic.
63- --> $DIR/indexing_slicing.rs:18 :6
63+ --> $DIR/indexing_slicing.rs:17 :6
6464 |
6565LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
6666 | ^^^^^^^^^^^^^^^
6767 |
6868 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
6969
7070error: slicing may panic.
71- --> $DIR/indexing_slicing.rs:21 :6
71+ --> $DIR/indexing_slicing.rs:20 :6
7272 |
7373LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
7474 | ^^^^^^^^^^^^
7575 |
7676 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
7777
7878error: range is out of bounds
79- --> $DIR/indexing_slicing.rs:21 :8
79+ --> $DIR/indexing_slicing.rs:20 :8
8080 |
8181LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
8282 | ^
8383 |
8484 = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
8585
8686error: slicing may panic.
87- --> $DIR/indexing_slicing.rs:22 :6
87+ --> $DIR/indexing_slicing.rs:21 :6
8888 |
8989LL | &x[0..][..3];
9090 | ^^^^^^^^^^^
9191 |
9292 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
9393
9494error: slicing may panic.
95- --> $DIR/indexing_slicing.rs:23 :6
95+ --> $DIR/indexing_slicing.rs:22 :6
9696 |
9797LL | &x[1..][..5];
9898 | ^^^^^^^^^^^
9999 |
100100 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
101101
102102error: indexing may panic.
103- --> $DIR/indexing_slicing.rs:31 :5
103+ --> $DIR/indexing_slicing.rs:30 :5
104104 |
105105LL | y[0];
106106 | ^^^^
107107 |
108108 = help: Consider using `.get(n)` or `.get_mut(n)` instead
109109
110110error: slicing may panic.
111- --> $DIR/indexing_slicing.rs:32 :6
111+ --> $DIR/indexing_slicing.rs:31 :6
112112 |
113113LL | &y[1..2];
114114 | ^^^^^^^
115115 |
116116 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
117117
118118error: slicing may panic.
119- --> $DIR/indexing_slicing.rs:33 :6
119+ --> $DIR/indexing_slicing.rs:32 :6
120120 |
121121LL | &y[0..=4];
122122 | ^^^^^^^^
123123 |
124124 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
125125
126126error: slicing may panic.
127- --> $DIR/indexing_slicing.rs:34 :6
127+ --> $DIR/indexing_slicing.rs:33 :6
128128 |
129129LL | &y[..=4];
130130 | ^^^^^^^
131131 |
132132 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
133133
134134error: indexing may panic.
135- --> $DIR/indexing_slicing.rs:39 :5
135+ --> $DIR/indexing_slicing.rs:38 :5
136136 |
137137LL | v[0];
138138 | ^^^^
139139 |
140140 = help: Consider using `.get(n)` or `.get_mut(n)` instead
141141
142142error: indexing may panic.
143- --> $DIR/indexing_slicing.rs:40 :5
143+ --> $DIR/indexing_slicing.rs:39 :5
144144 |
145145LL | v[10];
146146 | ^^^^^
147147 |
148148 = help: Consider using `.get(n)` or `.get_mut(n)` instead
149149
150150error: indexing may panic.
151- --> $DIR/indexing_slicing.rs:41 :5
151+ --> $DIR/indexing_slicing.rs:40 :5
152152 |
153153LL | v[1 << 3];
154154 | ^^^^^^^^^
155155 |
156156 = help: Consider using `.get(n)` or `.get_mut(n)` instead
157157
158158error: slicing may panic.
159- --> $DIR/indexing_slicing.rs:42 :6
159+ --> $DIR/indexing_slicing.rs:41 :6
160160 |
161161LL | &v[10..100];
162162 | ^^^^^^^^^^
163163 |
164164 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
165165
166166error: slicing may panic.
167- --> $DIR/indexing_slicing.rs:43 :6
167+ --> $DIR/indexing_slicing.rs:42 :6
168168 |
169169LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
170170 | ^^^^^^^^^^^^^^
171171 |
172172 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
173173
174174error: range is out of bounds
175- --> $DIR/indexing_slicing.rs:43 :8
175+ --> $DIR/indexing_slicing.rs:42 :8
176176 |
177177LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
178178 | ^^
179179
180180error: slicing may panic.
181- --> $DIR/indexing_slicing.rs:44 :6
181+ --> $DIR/indexing_slicing.rs:43 :6
182182 |
183183LL | &v[10..];
184184 | ^^^^^^^
185185 |
186186 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
187187
188188error: slicing may panic.
189- --> $DIR/indexing_slicing.rs:45 :6
189+ --> $DIR/indexing_slicing.rs:44 :6
190190 |
191191LL | &v[..100];
192192 | ^^^^^^^^
193193 |
194194 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
195195
196196error: indexing may panic.
197- --> $DIR/indexing_slicing.rs:57 :5
197+ --> $DIR/indexing_slicing.rs:56 :5
198198 |
199199LL | v[N];
200200 | ^^^^
201201 |
202202 = help: Consider using `.get(n)` or `.get_mut(n)` instead
203203
204204error: indexing may panic.
205- --> $DIR/indexing_slicing.rs:58 :5
205+ --> $DIR/indexing_slicing.rs:57 :5
206206 |
207207LL | v[M];
208208 | ^^^^
0 commit comments