Closed
Description
I tried this code:
fn main() {
if true {
'l : loop {
break 'l;
}
} else {
'l : loop {
break 'l;
}
}
}
I expected to see this happen: no warning regarding to label
Instead, this happened: got warning about label shadowing
warning: label name `'l` shadows a label name that is already in scope
--> src/main.rs:7:9
|
3 | 'l : loop {
| -- first declared here
...
7 | 'l : loop {
| ^^ label `'l` already in scope
version
Build using the Nightly version: 1.56.0-nightly
(2021-08-21 d3e2578c31688619ddc0)