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

attributes on binary expressions trigger unused_parens lint #43279

Closed
oli-obk opened this issue Jul 17, 2017 · 0 comments · Fixed by #64472
Closed

attributes on binary expressions trigger unused_parens lint #43279

oli-obk opened this issue Jul 17, 2017 · 0 comments · Fixed by #64472
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Jul 17, 2017

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
@Mark-Simulacrum Mark-Simulacrum added the A-diagnostics Area: Messages for errors, warnings, and lints label Jul 19, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 26, 2017
@bors bors closed this as completed in 0592d13 Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants