]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-slice-oob.rs
Rollup merge of #107023 - scottmcm:stop-shouting, r=Nilstrieb
[rust.git] / tests / ui / consts / const-slice-oob.rs
1 const FOO: &'static[u32] = &[1, 2, 3];
2 const BAR: u32 = FOO[5];
3 //~^ index out of bounds: the length is 3 but the index is 5
4 //~| ERROR evaluation of constant value failed
5
6 fn main() {
7     let _ = BAR;
8 }