1 error[E0080]: evaluation of `main::{constant#3}` failed
2 --> $DIR/indexing_slicing_index.rs:31:14
4 LL | const { &ARR[idx4()] }; // Ok, let rustc handle const contexts.
5 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
7 error[E0080]: erroneous constant used
8 --> $DIR/indexing_slicing_index.rs:31:5
10 LL | const { &ARR[idx4()] }; // Ok, let rustc handle const contexts.
11 | ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
13 error: indexing may panic
14 --> $DIR/indexing_slicing_index.rs:22:5
19 = help: consider using `.get(n)` or `.get_mut(n)` instead
20 = note: `-D clippy::indexing-slicing` implied by `-D warnings`
22 error: indexing may panic
23 --> $DIR/indexing_slicing_index.rs:38:5
28 = help: consider using `.get(n)` or `.get_mut(n)` instead
30 error: indexing may panic
31 --> $DIR/indexing_slicing_index.rs:39:5
36 = help: consider using `.get(n)` or `.get_mut(n)` instead
38 error: indexing may panic
39 --> $DIR/indexing_slicing_index.rs:40:5
44 = help: consider using `.get(n)` or `.get_mut(n)` instead
46 error: indexing may panic
47 --> $DIR/indexing_slicing_index.rs:46:5
52 = help: consider using `.get(n)` or `.get_mut(n)` instead
54 error: indexing may panic
55 --> $DIR/indexing_slicing_index.rs:47:5
60 = help: consider using `.get(n)` or `.get_mut(n)` instead
62 error[E0080]: evaluation of constant value failed
63 --> $DIR/indexing_slicing_index.rs:10:24
65 LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
66 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
68 error: aborting due to 9 previous errors
70 For more information about this error, try `rustc --explain E0080`.