summaryrefslogtreecommitdiffstats
path: root/tests/ui/for-loop-while/while-loop-constraints-2.rs
blob: 3c5cdf06cd85c1ebf5dc5cd54f3d02438b38d54b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![allow(unused_assignments)]
#![allow(unused_variables)]

pub fn main() {
    let mut y: isize = 42;
    let mut z: isize = 42;
    let mut x: isize;
    while z < 50 {
        z += 1;
        while false { x = y; y = z; }
        println!("{}", y);
    }
    assert!((y == 42 && z == 50));
}