-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
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.L-false-negativeLint: False negative (should have fired but didn't).Lint: False negative (should have fired but didn't).L-unused_variablesLint: unused_variablesLint: unused_variablesT-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
fn main() {
let mut overwritten = false;
let _ = || overwritten = true;
}
does not trigger any lints while
fn main() {
let mut overwritten = false;
if false {
overwritten = true;
}
}
results in
warning: variable `overwritten` is assigned to, but never used
--> src/main.rs:2:13
|
2 | let mut overwritten = false;
| ^^^^^^^^^^^
|
= note: consider using `_overwritten` instead
= note: `#[warn(unused_variables)]` on by default
The unused_variables
and lint should look into nested closures here.
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.L-false-negativeLint: False negative (should have fired but didn't).Lint: False negative (should have fired but didn't).L-unused_variablesLint: unused_variablesLint: unused_variablesT-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.