]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-slice-oob.rs
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / 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 }