]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/mir_indexing_oob_2.rs
Rollup merge of #72605 - GuillaumeGomez:cleanup-e0617, r=Dylan-DPC
[rust.git] / src / test / ui / mir / mir_indexing_oob_2.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: &'static [u8; 5] = b"hello";
6
7 #[allow(unconditional_panic)]
8 fn test() -> u8 {
9     C[10]
10 }
11
12 fn main() {
13     test();
14 }