2017-02-15 15:00:20 +02:00
|
|
|
const FOO: [usize; 3] = [1, 2, 3];
|
2024-02-14 12:28:07 +00:00
|
|
|
const BAR: usize = FOO[5];
|
2025-05-28 10:29:08 +00:00
|
|
|
//~^ ERROR: index out of bounds: the length is 3 but the index is 5
|
2015-11-18 10:57:52 +01:00
|
|
|
|
|
|
|
|
const BLUB: [u32; FOO[4]] = [5, 6];
|
2025-05-28 10:29:08 +00:00
|
|
|
//~^ ERROR index out of bounds: the length is 3 but the index is 4
|
2015-03-12 00:19:37 +01:00
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let _ = BAR;
|
|
|
|
|
}
|