2015-10-04 15:32:49 -05:00
|
|
|
const FOO: &'static[u32] = &[1, 2, 3];
|
2016-05-26 14:09:48 -05:00
|
|
|
const BAR: u32 = FOO[5];
|
2020-09-15 14:34:50 -05:00
|
|
|
//~^ index out of bounds: the length is 3 but the index is 5
|
2022-09-21 06:05:20 -05:00
|
|
|
//~| ERROR evaluation of constant value failed
|
2015-10-04 15:32:49 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = BAR;
|
|
|
|
}
|