]> git.lizzy.rs Git - rust.git/blob - tests/ui/unused_labels.rs
Auto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995
[rust.git] / tests / ui / unused_labels.rs
1 #![allow(dead_code, clippy::items_after_statements, clippy::never_loop)]
2 #![warn(clippy::unused_label)]
3
4 fn unused_label() {
5     'label: for i in 1..2 {
6         if i > 4 {
7             continue;
8         }
9     }
10 }
11
12 fn foo() {
13     'same_label_in_two_fns: loop {
14         break 'same_label_in_two_fns;
15     }
16 }
17
18 fn bla() {
19     'a: loop {
20         break;
21     }
22     fn blub() {}
23 }
24
25 fn main() {
26     'a: for _ in 0..10 {
27         while let Some(42) = None {
28             continue 'a;
29         }
30     }
31
32     'same_label_in_two_fns: loop {
33         let _ = 1;
34     }
35 }