-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-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
rustc 1.36.0-nightly (8dd4aae9a 2019-05-04)
binary: rustc
commit-hash: 8dd4aae9a83964cc08505da92d07ec68a3a2341d
commit-date: 2019-05-04
host: x86_64-pc-windows-msvc
release: 1.36.0-nightly
LLVM version: 8.0
#![feature(async_await)]
#![deny(unused_mut)]
pub struct S;
pub async fn foo(mut s: S) {
let _ = &mut s;
}
raises unused_mut
on the s
parameter of foo
.
@taiki-e This is also raised in the test case you added in #60501, but I assume the test passes because it defaults to ignoring the warning.
Workaround:
-pub async fn foo(mut s: S) {
+pub async fn foo(s: S) {
+ let mut s = s;
let _ = &mut s;
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-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.