rust/tests/mir-opt/const_prop/mutable_variable_no_prop.rs
2023-01-11 09:32:08 +00:00

14 lines
210 B
Rust

// unit-test
// compile-flags: -O
static mut STATIC: u32 = 42;
// EMIT_MIR mutable_variable_no_prop.main.ConstProp.diff
fn main() {
let mut x = 42;
unsafe {
x = STATIC;
}
let y = x;
}