fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
541 B29 linesraw
1// run-rustfix
2
3// These are forbidden occurrences of label-break-value
4
5#[allow(unused_unsafe)]
6fn labeled_unsafe() {
7    unsafe {} //~ ERROR block label not supported here
8}
9
10fn labeled_if() {
11    if true {} //~ ERROR block label not supported here
12}
13
14fn labeled_else() {
15    if true {} else {} //~ ERROR block label not supported here
16}
17
18fn labeled_match() {
19    match false { //~ ERROR block label not supported here
20        _ => {}
21    }
22}
23
24fn main() {
25    labeled_unsafe();
26    labeled_if();
27    labeled_else();
28    labeled_match();
29}