Skip to content

unused_parens should lint superfluous parentheses on the LHS of an assignment #71329

Open
@fanzier

Description

@fanzier

I tried this code:

#[deny(unused_parens)]

fn main() {
    let mut a = 5;
    (((((a))))) = 6;
}

I expected to see this happen: the compiler should reject this because there are unused parentheses on the left-hand side of the assignment.

Instead, this happened: the code compiled without errors.

Meta

This bug exists on current stable, beta and nightly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-false-negativeLint: False negative (should have fired but didn't).L-unused_parensLint: unused_parensT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions