2018-05-23 04:56:02 +00:00
|
|
|
error: indexing may panic. Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:11:5
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
11 | x[index];
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D indexing-slicing` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:12:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
12 | &x[index_from..index_to];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:13:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
13 | &x[index_from..][..index_to];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:13:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
13 | &x[index_from..][..index_to];
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:14:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
14 | &x[index..];
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:15:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
15 | &x[..index];
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2017-05-17 12:19:44 +00:00
|
|
|
error: const index is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:18:5
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
18 | x[4];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:20:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
20 | &x[1..5];
|
|
|
|
| ^^^^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:20:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
20 | &x[1..5];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:21:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
21 | &x[1..][..5];
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:23:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
23 | &x[0..][..3];
|
|
|
|
| ^^^^^^^^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:25:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
25 | &x[..=4];
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:25:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
25 | &x[..=4];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:29:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
29 | &x[5..];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:29:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
29 | &x[5..];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:31:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
31 | &x[..5];
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:31:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
31 | &x[..5];
|
|
|
|
| ^^^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: indexing may panic. Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:34:5
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
34 | y[0];
|
|
|
|
| ^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:35:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
35 | &y[1..2];
|
|
|
|
| ^^^^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:38:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
38 | &y[..=4];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: const index is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:41:5
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
41 | empty[0];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:42:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
42 | &empty[1..5];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:42:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
42 | &empty[1..5];
|
|
|
|
| ^^^^^^^^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:44:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
44 | &empty[..=4];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:44:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
44 | &empty[..=4];
|
|
|
|
| ^^^^^^^^^^^
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:49:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
49 | &empty[..=0];
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:49:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
49 | &empty[..=0];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:51:6
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
51 | &empty[1..];
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:51:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
51 | &empty[1..];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:52:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
52 | &empty[..4];
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:52:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
52 | &empty[..4];
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: indexing may panic. Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:55:5
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
55 | v[0];
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: indexing may panic. Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:56:5
|
2017-05-17 12:19:44 +00:00
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
56 | v[10];
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:57:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
57 | &v[10..100];
|
2017-05-17 12:19:44 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-05-23 04:56:02 +00:00
|
|
|
error: slicing may panic. Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:58:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
58 | &v[10..];
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
error: slicing may panic. Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 05:02:07 +00:00
|
|
|
--> $DIR/indexing_slicing.rs:59:6
|
2018-05-23 04:56:02 +00:00
|
|
|
|
|
|
|
|
59 | &v[..100];
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 36 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|