-
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.F-bindings_after_at`#![feature(bindings_after_at)]``#![feature(bindings_after_at)]`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
Here I use the bindings_after_at feature, I need the sub-bindings to be immutable, but I want to mutate the whole tuple variable:
#![feature(bindings_after_at)]
fn main() {
let mut xy @ (x, y) = (10, 20);
println!("{} {}", x, y);
println!("{:?}", xy);
xy = (30, 40);
println!("{:?}", xy);
}
It gives wrong warnings:
warning: variable does not need to be mutable
--> ...\test.rs:3:19
|
3 | let mut xy @ (x, y) = (10, 20);
| ^ help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> ...\test.rs:3:22
|
3 | let mut xy @ (x, y) = (10, 20);
| ^ help: remove this `mut`
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.F-bindings_after_at`#![feature(bindings_after_at)]``#![feature(bindings_after_at)]`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.