summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/const_prop/boxes.rs
blob: 9407759cb127b30d8dd10d5c5aba6de8f14f4c64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// unit-test: ConstProp
// compile-flags: -O
// ignore-emscripten compiled with panic=abort by default
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// ignore-wasm64

#![feature(rustc_attrs, stmt_expr_attributes)]

// Note: this test verifies that we, in fact, do not const prop `#[rustc_box]`

// EMIT_MIR boxes.main.ConstProp.diff
fn main() {
    let x = *(#[rustc_box]
    Box::new(42))
        + 0;
}