about summary refs log tree commit diff
path: root/tests/ui/mir/mir_indexing_oob_2.rs
blob: 310a7f8f2b75fefad9eb5d420c7111c131ec1596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ run-fail
//@ error-pattern:index out of bounds: the len is 5 but the index is 10
//@ needs-subprocess

const C: &'static [u8; 5] = b"hello";

#[allow(unconditional_panic)]
fn test() -> u8 {
    C[10]
}

fn main() {
    test();
}