]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/unused_labels.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unused_labels.rs
1
2
3
4 #![allow(dead_code, items_after_statements, never_loop)]
5 #![warn(unused_label)]
6
7 fn unused_label() {
8 'label: for i in 1..2 {
9 if i > 4 { continue }
10 }
11 }
12
13 fn foo() {
14 'same_label_in_two_fns: loop {
15 break 'same_label_in_two_fns;
16 }
17 }
18
19
20 fn bla() {
21 'a: loop { break }
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 }