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

20 lines
336 B
Rust
Raw Normal View History

// -*- rust -*-
fn main() {
2011-07-27 07:19:39 -05:00
let i: int = 90;
while i < 100 {
log_full(core::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);
}