-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)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
(sorry if this is an duplicate or the wrong repo 😇 )
fn main() {
let mut name;
name = format!("foo{}", "bar");
dbg!(name);
}
Current behavior:
no warning
Expected behavior:
warning: variable does not need to be mutable
--> src/main.rs:2:9
|
2 | let mut name;
| ----^
| |
| help: remove this `mut`
|
= note: #[warn(unused_mut)] on by default
The variable clearly doesn't need to be mutable, still, nothing is detected and no warning is emitted.
Rust 1.35.0
(Using the playground, also in 1.37.0-nightly
(2019-05-31 7840a0b753a065a41999
))
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)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.