2020-01-08 20:31:08 +00:00
|
|
|
warning: index out of bounds: the len is 3 but the index is 4
|
2020-01-17 21:34:33 +00:00
|
|
|
--> $DIR/array-literal-index-oob.rs:7:8
|
2019-06-06 19:23:17 +00:00
|
|
|
|
|
2020-01-08 20:31:08 +00:00
|
|
|
LL | &{ [1, 2, 3][4] };
|
|
|
|
| ^^^^^^^^^^^^
|
2019-06-06 19:23:17 +00:00
|
|
|
|
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2020-01-17 21:34:33 +00:00
|
|
|
--> $DIR/array-literal-index-oob.rs:4:9
|
2019-06-06 19:23:17 +00:00
|
|
|
|
|
2020-01-08 20:31:08 +00:00
|
|
|
LL | #![warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
2019-06-06 19:23:17 +00:00
|
|
|
|
2020-01-08 20:31:08 +00:00
|
|
|
warning: reaching this expression at runtime will panic or abort
|
2020-01-17 21:34:33 +00:00
|
|
|
--> $DIR/array-literal-index-oob.rs:7:8
|
2019-11-22 20:26:09 +00:00
|
|
|
|
|
2020-01-08 20:31:08 +00:00
|
|
|
LL | &{ [1, 2, 3][4] };
|
|
|
|
| ---^^^^^^^^^^^^--
|
|
|
|
| |
|
|
|
|
| indexing out of bounds: the len is 3 but the index is 4
|
2019-11-22 20:26:09 +00:00
|
|
|
|
2020-01-08 20:31:08 +00:00
|
|
|
warning: erroneous constant used
|
2020-01-17 21:34:33 +00:00
|
|
|
--> $DIR/array-literal-index-oob.rs:7:5
|
2020-01-08 20:31:08 +00:00
|
|
|
|
|
|
|
|
LL | &{ [1, 2, 3][4] };
|
|
|
|
| ^^^^^^^^^^^^^^^^^ referenced constant has errors
|
2019-06-06 19:23:17 +00:00
|
|
|
|