]> git.proxmox.com Git - rustc.git/blob - tests/ui/for-loop-while/while-with-break.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / for-loop-while / while-with-break.rs
1 // run-pass
2
3 pub fn main() {
4 let mut i: isize = 90;
5 while i < 100 {
6 println!("{}", i);
7 i = i + 1;
8 if i == 95 {
9 let _v: Vec<isize> =
10 vec![1, 2, 3, 4, 5]; // we check that it is freed by break
11
12 println!("breaking");
13 break;
14 }
15 }
16 assert_eq!(i, 95);
17 }