@@ -48,18 +48,18 @@ error: slicing may panic.
48
48
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
49
49
50
50
error: range is out of bounds
51
- --> $DIR/indexing_slicing.rs:30:6
51
+ --> $DIR/indexing_slicing.rs:30:11
52
52
|
53
53
30 | &x[..=4];
54
- | ^^^^^^ ^
54
+ | ^
55
55
|
56
56
= note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
57
57
58
58
error: range is out of bounds
59
- --> $DIR/indexing_slicing.rs:31:6
59
+ --> $DIR/indexing_slicing.rs:31:11
60
60
|
61
61
31 | &x[1..5];
62
- | ^^^^^^ ^
62
+ | ^
63
63
64
64
error: slicing may panic.
65
65
--> $DIR/indexing_slicing.rs:32:6
@@ -70,34 +70,34 @@ error: slicing may panic.
70
70
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
71
71
72
72
error: range is out of bounds
73
- --> $DIR/indexing_slicing.rs:32:6
73
+ --> $DIR/indexing_slicing.rs:32:8
74
74
|
75
75
32 | &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
76
- | ^^^^^ ^
76
+ | ^
77
77
78
78
error: range is out of bounds
79
- --> $DIR/indexing_slicing.rs:33:6
79
+ --> $DIR/indexing_slicing.rs:33:8
80
80
|
81
81
33 | &x[5..];
82
- | ^^^^^ ^
82
+ | ^
83
83
84
84
error: range is out of bounds
85
- --> $DIR/indexing_slicing.rs:34:6
85
+ --> $DIR/indexing_slicing.rs:34:10
86
86
|
87
87
34 | &x[..5];
88
- | ^^^^^ ^
88
+ | ^
89
89
90
90
error: range is out of bounds
91
- --> $DIR/indexing_slicing.rs:35:6
91
+ --> $DIR/indexing_slicing.rs:35:8
92
92
|
93
93
35 | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
94
- | ^^^^^ ^
94
+ | ^
95
95
96
96
error: range is out of bounds
97
- --> $DIR/indexing_slicing.rs:36:6
97
+ --> $DIR/indexing_slicing.rs:36:12
98
98
|
99
99
36 | &x[0..=4];
100
- | ^^^^^^^ ^
100
+ | ^
101
101
102
102
error: slicing may panic.
103
103
--> $DIR/indexing_slicing.rs:37:6
@@ -148,46 +148,46 @@ error: slicing may panic.
148
148
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
149
149
150
150
error: range is out of bounds
151
- --> $DIR/indexing_slicing.rs:60:6
151
+ --> $DIR/indexing_slicing.rs:60:12
152
152
|
153
153
60 | &empty[1..5];
154
- | ^^^^^^^^^^ ^
154
+ | ^
155
155
156
156
error: range is out of bounds
157
- --> $DIR/indexing_slicing.rs:61:6
157
+ --> $DIR/indexing_slicing.rs:61:16
158
158
|
159
159
61 | &empty[0..=4];
160
- | ^^^^^^^^^^^ ^
160
+ | ^
161
161
162
162
error: range is out of bounds
163
- --> $DIR/indexing_slicing.rs:62:6
163
+ --> $DIR/indexing_slicing.rs:62:15
164
164
|
165
165
62 | &empty[..=4];
166
- | ^^^^^^^^^^ ^
166
+ | ^
167
167
168
168
error: range is out of bounds
169
- --> $DIR/indexing_slicing.rs:63:6
169
+ --> $DIR/indexing_slicing.rs:63:12
170
170
|
171
171
63 | &empty[1..];
172
- | ^^^^^^^^^ ^
172
+ | ^
173
173
174
174
error: range is out of bounds
175
- --> $DIR/indexing_slicing.rs:64:6
175
+ --> $DIR/indexing_slicing.rs:64:14
176
176
|
177
177
64 | &empty[..4];
178
- | ^^^^^^^^^ ^
178
+ | ^
179
179
180
180
error: range is out of bounds
181
- --> $DIR/indexing_slicing.rs:65:6
181
+ --> $DIR/indexing_slicing.rs:65:16
182
182
|
183
183
65 | &empty[0..=0];
184
- | ^^^^^^^^^^^ ^
184
+ | ^
185
185
186
186
error: range is out of bounds
187
- --> $DIR/indexing_slicing.rs:66:6
187
+ --> $DIR/indexing_slicing.rs:66:15
188
188
|
189
189
66 | &empty[..=0];
190
- | ^^^^^^^^^^ ^
190
+ | ^
191
191
192
192
error: indexing may panic.
193
193
--> $DIR/indexing_slicing.rs:74:5
@@ -230,10 +230,10 @@ error: slicing may panic.
230
230
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
231
231
232
232
error: range is out of bounds
233
- --> $DIR/indexing_slicing.rs:78:6
233
+ --> $DIR/indexing_slicing.rs:78:8
234
234
|
235
235
78 | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
236
- | ^^^^^ ^^
236
+ | ^^
237
237
238
238
error: slicing may panic.
239
239
--> $DIR/indexing_slicing.rs:79:6
@@ -268,16 +268,16 @@ error: indexing may panic.
268
268
= help: Consider using `.get(n)` or `.get_mut(n)` instead
269
269
270
270
error: range is out of bounds
271
- --> $DIR/indexing_slicing.rs:97:6
271
+ --> $DIR/indexing_slicing.rs:97:13
272
272
|
273
273
97 | &x[num..10]; // should trigger out of bounds error
274
- | ^^^^^^^^ ^^
274
+ | ^^
275
275
276
276
error: range is out of bounds
277
- --> $DIR/indexing_slicing.rs:98:6
277
+ --> $DIR/indexing_slicing.rs:98:8
278
278
|
279
279
98 | &x[10..num]; // should trigger out of bounds error
280
- | ^^^^^^^^ ^^
280
+ | ^^
281
281
282
282
error: aborting due to 39 previous errors
283
283
0 commit comments