Closed
Description
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=88ae8b7f1d4eb4b2fb318e957cd3695d
fn foo(x: u32) {
match x {
1 => {
'outer: loop { break 'outer }
}
_ => {
'outer: loop { break 'outer }
}
}
}
The current output is:
warning: label name `'outer` shadows a label name that is already in scope
--> src/lib.rs:7:13
|
4 | 'outer: loop { break 'outer }
| ------ first declared here
...
7 | 'outer: loop { break 'outer }
| ^^^^^^ label `'outer` already in scope
I don't think this warning should be emitted, since as far as I understand there's no valid way that one match arm's 'outer
label could be used from the other match arm. So I don't think there is shadowing taking place here, but rather defining two entirely separate labels in two entirely separate scopes.