2017-02-15 07:00:20 -06:00
|
|
|
const FOO: [usize; 3] = [1, 2, 3];
|
|
|
|
const BAR: usize = FOO[5]; // no error, because the error below occurs before regular const eval
|
2015-11-18 03:57:52 -06:00
|
|
|
|
|
|
|
const BLUB: [u32; FOO[4]] = [5, 6];
|
2018-08-26 08:19:34 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed [E0080]
|
2020-09-15 14:34:50 -05:00
|
|
|
//~| index out of bounds: the length is 3 but the index is 4
|
2015-03-11 18:19:37 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = BAR;
|
|
|
|
}
|