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

19 lines
315 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 i;
i = i + 1;
2011-07-27 07:19:39 -05:00
if i == 95 {
let v: vec[int] =
[1, 2, 3, 4, 5]; // we check that it is freed by break
log "breaking";
break;
}
}
assert (i == 95);
}