summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
blob: 3d252f2d221b7d69ceaa3a0bda8a71097e14caec (plain)
1
2
3
4
5
6
7
8
9
10
// ignore-wasm32 compiled with panic=abort by default
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR bad_op_unsafe_oob_for_slices.main.ConstProp.diff
#[allow(unconditional_panic)]
fn main() {
    let a: *const [_] = &[1, 2, 3];
    unsafe {
        let _b = (*a)[3];
    }
}