A function is using continue
keyword incorrectly.
Erroneous code example:
#![allow(unused)]
fn main() {
fn continue_simple() {
'b: {
continue;
}
}
fn continue_labeled() {
'b: {
continue 'b;
}
}
fn continue_crossing() {
loop {
'b: {
continue;
}
}
}
}
ⓘ
Here we have used the continue
keyword incorrectly. As we
have seen above that continue
pointing to a labeled block.
To fix this we have to use the labeled block properly.
For example:
#![allow(unused)]
fn main() {
fn continue_simple() {
'b: loop {
continue ;
}
}
fn continue_labeled() {
'b: loop {
continue 'b;
}
}
fn continue_crossing() {
loop {
'b: loop {
continue;
}
}
}
}