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

20 lines
329 B
Rust
Raw Normal View History

// -*- rust -*-
fn main() {
let mut i: int = 90;
2011-07-27 07:19:39 -05:00
while i < 100 {
log(debug, i);
i = i + 1;
2011-07-27 07:19:39 -05:00
if i == 95 {
let v: [int] =
[1, 2, 3, 4, 5]; // we check that it is freed by break
#debug("breaking");
break;
}
}
assert (i == 95);
}