Skip to content

attributes on binary expressions trigger unused_parens lint  #43279

Closed
@oli-obk

Description

@oli-obk

Yes the following code is pointless, but I needed any attribute to reproduce, so I chose a derive

#![feature(stmt_expr_attributes)]

fn main() {
    let x = #[derive(Foo)](5 + 6);
}

produces

warning: unnecessary parentheses around assigned value
 --> src/main.rs:4:27
  |
4 |     let x = #[derive(Foo)](5 + 6);
  |                           ^^^^^^^
  |
  = note: #[warn(unused_parens)] on by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions