-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This code
#![warn(unused_labels)]
fn main() {
'_unused: loop {
println!("hello world");
break;
}
}
yields this message
warning: unused label
--> src/main.rs:4:5
|
4 | '_unused: loop {
| ^^^^^^^^
|
note: lint level defined here
--> src/main.rs:1:9
|
1 | #![warn(unused_labels)]
| ^^^^^^^^^^^^^
I think this is not intended behavior: labels beginning with _
should be ignored by this lint, just as identifiers beginning with _
are ignored by similar lints in other contexts.
Right now I think this blocks Issue #66325, since we wouldn't want to start warn-by-default until it is fixed.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.