1 error[E0080]: evaluation of `main::{constant#3}` failed
4 LL | const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
5 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
7 note: erroneous constant used
10 LL | const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
11 | ^^^^^^^^^^^^^^^^^^^^^^
13 error: indexing may panic
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
28 = help: consider using `.get(n)` or `.get_mut(n)` instead
30 error: indexing may panic
36 = help: consider using `.get(n)` or `.get_mut(n)` instead
38 error: indexing may panic
44 = help: consider using `.get(n)` or `.get_mut(n)` instead
46 error: indexing may panic
52 = help: consider using `.get(n)` or `.get_mut(n)` instead
54 error: indexing may panic
60 = help: consider using `.get(n)` or `.get_mut(n)` instead
62 error[E0080]: evaluation of constant value failed
63 --> $DIR/test.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 8 previous errors
70 For more information about this error, try `rustc --explain E0080`.