]> git.proxmox.com Git - rustc.git/blob - tests/ui/mir/mir_indexing_oob_1.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / mir / mir_indexing_oob_1.rs
1 // run-fail
2 // error-pattern:index out of bounds: the len is 5 but the index is 10
3 // ignore-emscripten no processes
4
5 const C: [u32; 5] = [0; 5];
6
7 #[allow(unconditional_panic)]
8 fn test() -> u32 {
9 C[10]
10 }
11
12 fn main() {
13 test();
14 }