]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-37576.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-37576.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 fn main() {
12     'test_1: while break 'test_1 {}
13     while break {}
14     //~^ ERROR `break` or `continue` with no label
15
16     'test_2: while let true = break 'test_2 {}
17     while let true = break {}
18     //~^ ERROR `break` or `continue` with no label
19
20     loop { 'test_3: while break 'test_3 {} }
21     loop { while break {} }
22     //~^ ERROR `break` or `continue` with no label
23
24     loop {
25         'test_4: while break 'test_4 {}
26         break;
27     }
28     loop {
29         while break {}
30         //~^ ERROR `break` or `continue` with no label
31         break;
32     }
33
34     'test_5: while continue 'test_5 {}
35     while continue {}
36     //~^ ERROR `break` or `continue` with no label
37
38     'test_6: while let true = continue 'test_6 {}
39     while let true = continue {}
40     //~^ ERROR `break` or `continue` with no label
41
42     loop { 'test_7: while continue 'test_7 {} }
43     loop { while continue {} }
44     //~^ ERROR `break` or `continue` with no label
45
46     loop {
47         'test_8: while continue 'test_8 {}
48         continue;
49     }
50     loop {
51         while continue {}
52         //~^ ERROR `break` or `continue` with no label
53         continue;
54     }
55 }