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

26 lines
729 B
Text
Raw Normal View History

error: index out of bounds: the len is 3 but the index is 4
--> $DIR/array-literal-index-oob.rs:4:7
|
LL | &{[1, 2, 3][4]};
| ^^^^^^^^^^^^
|
= note: `#[deny(const_err)]` on by default
error: reaching this expression at runtime will panic or abort
--> $DIR/array-literal-index-oob.rs:4:7
|
LL | &{[1, 2, 3][4]};
| --^^^^^^^^^^^^-
| |
| indexing out of bounds: the len is 3 but the index is 4
error[E0080]: erroneous constant used
--> $DIR/array-literal-index-oob.rs:4:5
|
LL | &{[1, 2, 3][4]};
| ^^^^^^^^^^^^^^^ referenced constant has errors
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0080`.