rust/src/test/ui/consts/array-literal-index-oob.stderr

35 lines
987 B
Plaintext
Raw Normal View History

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