]> git.lizzy.rs Git - rust.git/blob - cycle.rs
6182878f3413d59b37ee9049d6f3e0644f193202
[rust.git] / cycle.rs
1 //! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
2 // unit-test: DestinationPropagation
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 }