A break statement without a label appeared inside a labeled block.
Erroneous code example:
#![allow(unused)]
fn main() {
loop {
'a: {
break;
}
}
} Make sure to always label the break:
#![allow(unused)]
fn main() {
'l: loop {
'a: {
break 'l;
}
}
} Or if you want to break the labeled block:
#![allow(unused)]
fn main() {
loop {
'a: {
break 'a;
}
break;
}
}
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0695.html