]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/dest-prop/cycle.rs
Rollup merge of #76891 - lcnr:less-ref, r=ecstatic-morse
[rust.git] / src / test / mir-opt / dest-prop / cycle.rs
1 //! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
2
3 fn val() -> i32 {
4     1
5 }
6
7 // EMIT_MIR cycle.main.DestinationPropagation.diff
8 fn main() {
9     let mut x = val();
10     let y = x;
11     let z = y;
12     x = z;
13
14     drop(x);
15 }