-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Incorrect label shadow warning #88225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ok. I digged up an exact duplicate here: #81799 This warning is very unintuitive. I got that this is intended in the links provided, but could not find out why, i.e. what harm does it do if I write it this way. @ehuss can you provide a link to the reason why this is intended that this can be discussed? |
I don't think there is any information beyond what is linked in those issues. This was something added before 1.0, and it hasn't been revisited since. The why is primarily explained in https://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833, where there was an intent to add explicit syntax for labeling a region for a borrow, but that never got beyond the idea stage (AFAIK). #24278 also explains how there are macro hygiene problems. |
I tried this code:
I expected to see this happen: no warning regarding to label
Instead, this happened: got warning about label shadowing
version
playground
The text was updated successfully, but these errors were encountered: