1
Fork 0
rust/src/test/mir-opt/const_prop/optimizes_into_variable.rs

15 lines
276 B
Rust
Raw Normal View History

// compile-flags: -C overflow-checks=on
struct Point {
x: u32,
y: u32,
}
2020-04-04 17:15:01 +00:00
// EMIT_MIR rustc.main.ConstProp.diff
// EMIT_MIR rustc.main.SimplifyLocals.after.mir
fn main() {
let x = 2 + 2;
let y = [0, 1, 2, 3, 4, 5][3];
let z = (Point { x: 12, y: 42}).y;
}