Skip to content

[Diagnostic ER] Missing unnecessary parentheses warning #96606

@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);
}

Activity

added
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.
on Jan 30, 2023
PossiblyAShrub

PossiblyAShrub commented on Jan 31, 2023

@PossiblyAShrub
Contributor

@rustbot claim

added 2 commits that reference this issue on Feb 3, 2023
a40fcb3
d9db357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Participants

    @leonardo-m@PossiblyAShrub@Noratrieb

    Issue actions

      [Diagnostic ER] Missing unnecessary parentheses warning · Issue #96606 · rust-lang/rust