2022-01-12 20:43:24 +00:00
|
|
|
// run-rustfix
|
2018-05-12 09:33:33 +00:00
|
|
|
|
2018-08-19 13:30:23 +00:00
|
|
|
// These are forbidden occurrences of label-break-value
|
2018-05-12 07:54:53 +00:00
|
|
|
|
2022-01-12 20:43:24 +00:00
|
|
|
#[allow(unused_unsafe)]
|
2018-05-12 07:54:53 +00:00
|
|
|
fn labeled_unsafe() {
|
2022-01-12 20:43:24 +00:00
|
|
|
unsafe 'b: {} //~ ERROR block label not supported here
|
2018-05-12 07:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn labeled_if() {
|
2022-01-12 20:43:24 +00:00
|
|
|
if true 'b: {} //~ ERROR block label not supported here
|
2018-05-12 07:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn labeled_else() {
|
2022-01-12 20:43:24 +00:00
|
|
|
if true {} else 'b: {} //~ ERROR block label not supported here
|
2018-05-12 07:54:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn labeled_match() {
|
2022-01-12 20:43:24 +00:00
|
|
|
match false 'b: { //~ ERROR block label not supported here
|
|
|
|
_ => {}
|
|
|
|
}
|
2018-05-12 07:54:53 +00:00
|
|
|
}
|
|
|
|
|
2022-01-12 20:43:24 +00:00
|
|
|
fn main() {
|
|
|
|
labeled_unsafe();
|
|
|
|
labeled_if();
|
|
|
|
labeled_else();
|
|
|
|
labeled_match();
|
|
|
|
}
|