]> git.lizzy.rs Git - rust.git/blob - tests/ui/for-loop-while/while-loop-constraints-2.rs
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / for-loop-while / while-loop-constraints-2.rs
1 // run-pass
2 #![allow(unused_assignments)]
3 #![allow(unused_variables)]
4
5 pub fn main() {
6     let mut y: isize = 42;
7     let mut z: isize = 42;
8     let mut x: isize;
9     while z < 50 {
10         z += 1;
11         while false { x = y; y = z; }
12         println!("{}", y);
13     }
14     assert!((y == 42 && z == 50));
15 }