@@ -48,18 +48,18 @@ error: slicing may panic.
4848 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
4949
5050error: range is out of bounds
51- --> $DIR/indexing_slicing.rs:30:6
51+ --> $DIR/indexing_slicing.rs:30:11
5252 |
535330 | &x[..=4];
54- | ^^^^^^ ^
54+ | ^
5555 |
5656 = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
5757
5858error: range is out of bounds
59- --> $DIR/indexing_slicing.rs:31:6
59+ --> $DIR/indexing_slicing.rs:31:11
6060 |
616131 | &x[1..5];
62- | ^^^^^^ ^
62+ | ^
6363
6464error: slicing may panic.
6565 --> $DIR/indexing_slicing.rs:32:6
@@ -70,34 +70,34 @@ error: slicing may panic.
7070 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
7171
7272error: range is out of bounds
73- --> $DIR/indexing_slicing.rs:32:6
73+ --> $DIR/indexing_slicing.rs:32:8
7474 |
757532 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
76- | ^^^^^ ^
76+ | ^
7777
7878error: range is out of bounds
79- --> $DIR/indexing_slicing.rs:33:6
79+ --> $DIR/indexing_slicing.rs:33:8
8080 |
818133 | &x[5..];
82- | ^^^^^ ^
82+ | ^
8383
8484error: range is out of bounds
85- --> $DIR/indexing_slicing.rs:34:6
85+ --> $DIR/indexing_slicing.rs:34:10
8686 |
878734 | &x[..5];
88- | ^^^^^ ^
88+ | ^
8989
9090error: range is out of bounds
91- --> $DIR/indexing_slicing.rs:35:6
91+ --> $DIR/indexing_slicing.rs:35:8
9292 |
939335 | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
94- | ^^^^^ ^
94+ | ^
9595
9696error: range is out of bounds
97- --> $DIR/indexing_slicing.rs:36:6
97+ --> $DIR/indexing_slicing.rs:36:12
9898 |
999936 | &x[0..=4];
100- | ^^^^^^^ ^
100+ | ^
101101
102102error: slicing may panic.
103103 --> $DIR/indexing_slicing.rs:37:6
@@ -148,46 +148,46 @@ error: slicing may panic.
148148 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
149149
150150error: range is out of bounds
151- --> $DIR/indexing_slicing.rs:60:6
151+ --> $DIR/indexing_slicing.rs:60:12
152152 |
15315360 | &empty[1..5];
154- | ^^^^^^^^^^ ^
154+ | ^
155155
156156error: range is out of bounds
157- --> $DIR/indexing_slicing.rs:61:6
157+ --> $DIR/indexing_slicing.rs:61:16
158158 |
15915961 | &empty[0..=4];
160- | ^^^^^^^^^^^ ^
160+ | ^
161161
162162error: range is out of bounds
163- --> $DIR/indexing_slicing.rs:62:6
163+ --> $DIR/indexing_slicing.rs:62:15
164164 |
16516562 | &empty[..=4];
166- | ^^^^^^^^^^ ^
166+ | ^
167167
168168error: range is out of bounds
169- --> $DIR/indexing_slicing.rs:63:6
169+ --> $DIR/indexing_slicing.rs:63:12
170170 |
17117163 | &empty[1..];
172- | ^^^^^^^^^ ^
172+ | ^
173173
174174error: range is out of bounds
175- --> $DIR/indexing_slicing.rs:64:6
175+ --> $DIR/indexing_slicing.rs:64:14
176176 |
17717764 | &empty[..4];
178- | ^^^^^^^^^ ^
178+ | ^
179179
180180error: range is out of bounds
181- --> $DIR/indexing_slicing.rs:65:6
181+ --> $DIR/indexing_slicing.rs:65:16
182182 |
18318365 | &empty[0..=0];
184- | ^^^^^^^^^^^ ^
184+ | ^
185185
186186error: range is out of bounds
187- --> $DIR/indexing_slicing.rs:66:6
187+ --> $DIR/indexing_slicing.rs:66:15
188188 |
18918966 | &empty[..=0];
190- | ^^^^^^^^^^ ^
190+ | ^
191191
192192error: indexing may panic.
193193 --> $DIR/indexing_slicing.rs:74:5
@@ -230,10 +230,10 @@ error: slicing may panic.
230230 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
231231
232232error: range is out of bounds
233- --> $DIR/indexing_slicing.rs:78:6
233+ --> $DIR/indexing_slicing.rs:78:8
234234 |
23523578 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
236- | ^^^^^ ^^
236+ | ^^
237237
238238error: slicing may panic.
239239 --> $DIR/indexing_slicing.rs:79:6
@@ -268,16 +268,16 @@ error: indexing may panic.
268268 = help: Consider using `.get(n)` or `.get_mut(n)` instead
269269
270270error: range is out of bounds
271- --> $DIR/indexing_slicing.rs:97:6
271+ --> $DIR/indexing_slicing.rs:97:13
272272 |
27327397 | &x[num..10]; // should trigger out of bounds error
274- | ^^^^^^^^ ^^
274+ | ^^
275275
276276error: range is out of bounds
277- --> $DIR/indexing_slicing.rs:98:6
277+ --> $DIR/indexing_slicing.rs:98:8
278278 |
27927998 | &x[10..num]; // should trigger out of bounds error
280- | ^^^^^^^^ ^^
280+ | ^^
281281
282282error: aborting due to 39 previous errors
283283
0 commit comments