rust/tests/mir-opt/const_prop/mutable_variable_no_prop.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
210 B
Rust
Raw Normal View History

2022-07-26 19:04:27 +02:00
// unit-test
// compile-flags: -O
static mut STATIC: u32 = 42;
2020-07-27 21:22:43 +02:00
// EMIT_MIR mutable_variable_no_prop.main.ConstProp.diff
fn main() {
let mut x = 42;
unsafe {
x = STATIC;
}
let y = x;
}