1 error: indexing may panic
2 --> $DIR/indexing_slicing_index.rs:9:20
4 LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
7 = help: consider using `.get(n)` or `.get_mut(n)` instead
8 = note: the suggestion might not be applicable in constant blocks
9 = note: `-D clippy::indexing-slicing` implied by `-D warnings`
11 error: indexing may panic
12 --> $DIR/indexing_slicing_index.rs:10:24
14 LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
17 = help: consider using `.get(n)` or `.get_mut(n)` instead
18 = note: the suggestion might not be applicable in constant blocks
20 error[E0080]: evaluation of `main::{constant#3}` failed
21 --> $DIR/indexing_slicing_index.rs:31:14
23 LL | const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
24 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
26 note: erroneous constant used
27 --> $DIR/indexing_slicing_index.rs:31:5
29 LL | const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
30 | ^^^^^^^^^^^^^^^^^^^^^^
32 error: indexing may panic
33 --> $DIR/indexing_slicing_index.rs:22:5
38 = help: consider using `.get(n)` or `.get_mut(n)` instead
40 error: indexing may panic
41 --> $DIR/indexing_slicing_index.rs:30:14
43 LL | const { &ARR[idx()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
46 = help: consider using `.get(n)` or `.get_mut(n)` instead
47 = note: the suggestion might not be applicable in constant blocks
49 error: indexing may panic
50 --> $DIR/indexing_slicing_index.rs:31:14
52 LL | const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
55 = help: consider using `.get(n)` or `.get_mut(n)` instead
56 = note: the suggestion might not be applicable in constant blocks
58 error: indexing may panic
59 --> $DIR/indexing_slicing_index.rs:38:5
64 = help: consider using `.get(n)` or `.get_mut(n)` instead
66 error: indexing may panic
67 --> $DIR/indexing_slicing_index.rs:39:5
72 = help: consider using `.get(n)` or `.get_mut(n)` instead
74 error: indexing may panic
75 --> $DIR/indexing_slicing_index.rs:40:5
80 = help: consider using `.get(n)` or `.get_mut(n)` instead
82 error: indexing may panic
83 --> $DIR/indexing_slicing_index.rs:46:5
88 = help: consider using `.get(n)` or `.get_mut(n)` instead
90 error: indexing may panic
91 --> $DIR/indexing_slicing_index.rs:47:5
96 = help: consider using `.get(n)` or `.get_mut(n)` instead
98 error[E0080]: evaluation of constant value failed
99 --> $DIR/indexing_slicing_index.rs:10:24
101 LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
102 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
104 error: aborting due to 12 previous errors
106 For more information about this error, try `rustc --explain E0080`.