]> git.lizzy.rs Git - rust.git/blob - tests/ui/for-loop-while/while-with-break.rs
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
[rust.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 }