PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/while-with-break.rs

http://github.com/jruderman/rust
Rust | 19 lines | 14 code | 4 blank | 1 comment | 4 complexity | 4728706299c0ac9b7ddea3dbbdc8f848 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn main() {
 6    let mut i: int = 90;
 7    while i < 100 {
 8        log(debug, i);
 9        i = i + 1;
10        if i == 95 {
11            let v: ~[int] =
12                ~[1, 2, 3, 4, 5]; // we check that it is freed by break
13
14            debug!{"breaking"};
15            break;
16        }
17    }
18    assert (i == 95);
19}