]> git.proxmox.com Git - rustc.git/blob - src/test/ui/for-loop-while/issue-2216.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / for-loop-while / issue-2216.rs
1 // run-pass
2 #![allow(unreachable_code)]
3 pub fn main() {
4 let mut x = 0;
5
6 'foo: loop {
7 'bar: loop {
8 loop {
9 if 1 == 2 {
10 break 'foo;
11 }
12 else {
13 break 'bar;
14 }
15 }
16 continue 'foo;
17 }
18 x = 42;
19 break;
20 }
21
22 println!("{}", x);
23 assert_eq!(x, 42);
24 }