]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/mir_indexing_oob_1.rs
Rollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-Simulacrum
[rust.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 }