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

20 lines
332 B
Rust
Raw Normal View History

// -*- rust -*-
pub fn main() {
let mut i: int = 90;
2011-07-27 07:19:39 -05:00
while i < 100 {
2013-03-08 14:39:42 -06:00
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
2012-08-22 19:24:52 -05:00
debug!("breaking");
break;
}
}
assert_eq!(i, 95);
}