]> git.lizzy.rs Git - rust.git/blob - src/test/ui/label/label_break_value_unlabeled_break.rs
Rollup merge of #99880 - compiler-errors:escape-ascii-is-not-exact-size-iterator...
[rust.git] / src / test / ui / label / label_break_value_unlabeled_break.rs
1 #![allow(unused_labels)]
2
3 // Simple unlabeled break should yield in an error
4 fn unlabeled_break_simple() {
5     'b: {
6         break; //~ ERROR unlabeled `break` inside of a labeled block
7     }
8 }
9
10 // Unlabeled break that would cross a labeled block should yield in an error
11 fn unlabeled_break_crossing() {
12     loop {
13         'b: {
14             break; //~ ERROR unlabeled `break` inside of a labeled block
15         }
16     }
17 }
18
19 pub fn main() {}