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