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

19 lines
321 B
Rust
Raw Normal View History

pub fn main() {
let mut i: int = 90;
2011-07-27 07:19:39 -05:00
while i < 100 {
info!("{}", i);
i = i + 1;
2011-07-27 07:19:39 -05:00
if i == 95 {
2013-08-17 10:37:42 -05:00
let _v: ~[int] =
~[1, 2, 3, 4, 5]; // we check that it is freed by break
info!("breaking");
break;
}
}
assert_eq!(i, 95);
}