]> git.lizzy.rs Git - rust.git/blob - tests/ui/array-slice-vec/dst-raw-slice.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / array-slice-vec / dst-raw-slice.rs
1 // Test bounds checking for DST raw slices
2
3 // run-fail
4 // error-pattern:index out of bounds
5 // ignore-emscripten no processes
6
7 #[allow(unconditional_panic)]
8 fn main() {
9     let a: *const [_] = &[1, 2, 3];
10     unsafe {
11         let _b = (*a)[3];
12     }
13 }