2018-06-14 07:28:57 +08:00
|
|
|
error: indexing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:11:5
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
11 | x[index];
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D indexing-slicing` implied by `-D warnings`
|
2018-06-14 07:28:57 +08:00
|
|
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:12:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
12 | &x[index_from..index_to];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:13:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
13 | &x[index_from..][..index_to];
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:13:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
13 | &x[index_from..][..index_to];
|
|
|
|
| ^^^^^^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:14:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
14 | &x[index..];
|
|
|
|
| ^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:15:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
15 | &x[..index];
|
|
|
|
| ^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2017-05-17 20:19:44 +08:00
|
|
|
error: const index is out of bounds
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:18:5
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-05-23 12:56:02 +08:00
|
|
|
18 | x[4];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= note: `-D out-of-bounds-indexing` implied by `-D warnings`
|
|
|
|
|
2018-05-23 12:56:02 +08:00
|
|
|
error: range is out of bounds
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:20:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-05-23 12:56:02 +08:00
|
|
|
20 | &x[1..5];
|
|
|
|
| ^^^^^^^
|
2017-05-17 20:19:44 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:21:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-05-23 12:56:02 +08:00
|
|
|
21 | &x[1..][..5];
|
|
|
|
| ^^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-05-23 13:02:07 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:23:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
|
|
|
23 | &x[0..][..3];
|
|
|
|
| ^^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-06-14 07:28:57 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:26:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
26 | &x[..=4];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^^
|
|
|
|
|
2017-05-17 20:19:44 +08:00
|
|
|
error: range is out of bounds
|
2018-06-14 07:28:57 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:30:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
30 | &x[5..];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^^^
|
|
|
|
|
2018-05-23 12:56:02 +08:00
|
|
|
error: range is out of bounds
|
2018-06-14 07:28:57 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:32:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
32 | &x[..5];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
error: range is out of bounds
|
|
|
|
--> $DIR/indexing_slicing.rs:33:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
33 | &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^
|
2017-05-17 20:19:44 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: indexing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:37:5
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
37 | y[0];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
2017-05-17 20:19:44 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:38:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
38 | &y[1..2];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2017-05-17 20:19:44 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:41:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
41 | &y[..=4];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
|
|
error: const index is out of bounds
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:44:5
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
44 | empty[0];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-06-14 07:28:57 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:45:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
45 | &empty[1..5];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:47:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
47 | &empty[..=4];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-06-14 07:28:57 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:52:6
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
52 | &empty[..=0];
|
|
|
|
| ^^^^^^^^^^^
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
|
|
error: range is out of bounds
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:54:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
54 | &empty[1..];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
error: range is out of bounds
|
|
|
|
--> $DIR/indexing_slicing.rs:55:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
55 | &empty[..4];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: indexing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:58:5
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
58 | v[0];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: indexing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:59:5
|
2017-05-17 20:19:44 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
59 | v[10];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n)` or `.get_mut(n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:60:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
60 | &v[10..100];
|
2017-05-17 20:19:44 +08:00
|
|
|
| ^^^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
|
2017-05-17 20:19:44 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:61:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
61 | &v[10..];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(n..)` or .get_mut(n..)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-14 07:28:57 +08:00
|
|
|
error: slicing may panic.
|
2018-06-15 00:41:56 +08:00
|
|
|
--> $DIR/indexing_slicing.rs:62:6
|
2018-05-23 12:56:02 +08:00
|
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
62 | &v[..100];
|
2018-05-23 12:56:02 +08:00
|
|
|
| ^^^^^^^^
|
2018-06-14 07:28:57 +08:00
|
|
|
|
|
|
|
|
= help: Consider using `.get(..n)`or `.get_mut(..n)` instead
|
2018-05-23 12:56:02 +08:00
|
|
|
|
2018-06-15 00:41:56 +08:00
|
|
|
error: aborting due to 28 previous errors
|
2018-01-17 00:06:27 +08:00
|
|
|
|