-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
E0005 has started issuing warnings for unused variables. It seems to just add noise, since the code is incorrect, the warning is a little misguided.
fn main() {
let x = Some(1);
let Some(y) = x; //~ ERROR E0005
}
displays:
error[E0005]: refutable pattern in local binding: `None` not covered
--> E0005.rs:3:9
|
LL | let Some(y) = x; //~ ERROR E0005
| ^^^^^^^ pattern `None` not covered
warning: unused variable: `y`
--> E0005.rs:3:14
|
LL | let Some(y) = x; //~ ERROR E0005
| ^ help: consider prefixing with an underscore: `_y`
|
= note: #[warn(unused_variables)] on by default
This started in #59050. I can't really tell which PR in that rollup is responsible.
This is a pretty minor issue, and perhaps issuing warnings makes more sense in other cases. Feel free to close this if it doesn't seem like an issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.