Skip to content

[Diagnostic ER] Missing unnecessary parentheses warning #96606

Closed
@leonardo-m

Description

@leonardo-m

rustc could give a unnecessary parentheses warning here:

fn main() {
    let arr = [0; 10];
    let i = 2;
    let y = arr[(5 - i)];
    dbg!(y);
}

Metadata

Metadata

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.T-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