2015-11-20 10:43:04 +01:00
|
|
|
#![feature(const_indexing)]
|
|
|
|
|
2017-02-15 15:00:20 +02: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 10:57:52 +01:00
|
|
|
|
|
|
|
const BLUB: [u32; FOO[4]] = [5, 6];
|
2018-08-26 15:19:34 +02:00
|
|
|
//~^ ERROR evaluation of constant value failed [E0080]
|
2016-07-20 00:02:56 +03:00
|
|
|
//~| index out of bounds: the len is 3 but the index is 4
|
2015-03-12 00:19:37 +01:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = BAR;
|
|
|
|
}
|