Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spurious unused_parens warning #55342

Closed
programmerjake opened this issue Oct 25, 2018 · 1 comment · Fixed by #64128
Closed

spurious unused_parens warning #55342

programmerjake opened this issue Oct 25, 2018 · 1 comment · Fixed by #64128
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@programmerjake
Copy link
Member

The following code produces a unused_parens warning however if the parenthesis around the mut v are removed the code doesn't compile:

pub fn f(v: &u32) -> u32 {
    let &(mut v) = v;
    v += 1;
    v
}
@estebank
Copy link
Contributor

This is caused by the stabilization of parentheses in patterns.

@estebank estebank added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. labels Oct 25, 2018
@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 1, 2019
@Centril Centril self-assigned this Sep 3, 2019
Centril added a commit to Centril/rust that referenced this issue Sep 5, 2019
@bors bors closed this as completed in 57ffc83 Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants