]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/dest-prop/cycle.rs
Rollup merge of #100382 - jackh726:gat-self-outlives-input, r=compiler-errors
[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 // compile-flags: -Zunsound-mir-opts
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 }