]> git.lizzy.rs Git - rust.git/blob - src/test/ui/label/label_break_value_continue.rs
Auto merge of #98457 - japaric:gh98378, r=m-ou-se
[rust.git] / src / test / ui / label / label_break_value_continue.rs
1 #![allow(unused_labels)]
2
3 // Simple continue pointing to an unlabeled break should yield in an error
4 fn continue_simple() {
5     'b: {
6         continue; //~ ERROR unlabeled `continue` inside of a labeled block
7     }
8 }
9
10 // Labeled continue pointing to an unlabeled break should yield in an error
11 fn continue_labeled() {
12     'b: {
13         continue 'b; //~ ERROR `continue` pointing to a labeled block
14     }
15 }
16
17 // Simple continue that would cross a labeled block should yield in an error
18 fn continue_crossing() {
19     loop {
20         'b: {
21             continue; //~ ERROR unlabeled `continue` inside of a labeled block
22         }
23     }
24 }
25
26 pub fn main() {}