summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
blob: d6b1a93f30499f3d18070e385bd3d417fe3ccd2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// unit-test: ConstProp
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// 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];
    }
}