]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs
Rollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomez
[rust.git] / tests / mir-opt / const_prop / mutable_variable_unprop_assign.rs
1 // unit-test
2 // compile-flags: -O
3
4 // EMIT_MIR mutable_variable_unprop_assign.main.ConstProp.diff
5 fn main() {
6     let a = foo();
7     let mut x: (i32, i32) = (1, 2);
8     x.1 = a;
9     let y = x.1;
10     let z = x.0; // this could theoretically be allowed, but we can't handle it right now
11 }
12
13 #[inline(never)]
14 fn foo() -> i32 {
15     unimplemented!()
16 }