Closed
Description
When compiling the following code:
fn main() {
'a: for _ in 0..1 { break 'a; }
'a: for _ in 0..1 { break 'a; }
}
rust emits the following warning:
warning: label name `'a` shadows a label name that is already in scope
--> src/main.rs:3:5
|
2 | 'a: for _ in 0..1 { break 'a; }
| -- first declared here
3 | 'a: for _ in 0..1 { break 'a; }
| ^^ lifetime 'a already in scope
I tried nightly in the playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=eda5af652ad2b13204432834e1b67f8e and got the same output
lifetime 'a already in scope
seems wrong, since 'a
is not a lifetime, but a label