summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-slice-oob.rs
blob: 429b9782132144fe4b0ec9886eb965874a3842ac (plain)
1
2
3
4
5
6
7
8
const FOO: &'static[u32] = &[1, 2, 3];
const BAR: u32 = FOO[5];
//~^ index out of bounds: the length is 3 but the index is 5
//~| ERROR evaluation of constant value failed

fn main() {
    let _ = BAR;
}