about summary refs log tree commit diff
path: root/tests/ui/for-loop-while/while-loop-constraints-2.rs
blob: 1d2d9c2ecfe60aabdc5ac801baf9b062219ecfd2 (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);
}