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

Disabling of the precedence lint is incorrect for chained expressions #5924

Closed
newpavlov opened this issue Aug 19, 2020 · 0 comments · Fixed by #5928
Closed

Disabling of the precedence lint is incorrect for chained expressions #5924

newpavlov opened this issue Aug 19, 2020 · 0 comments · Fixed by #5928
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@newpavlov
Copy link

newpavlov commented Aug 19, 2020

In #4892 it was requested that the precedence lint should be disabled for odd functions, but it looks like the fix was implemented incorrectly, as seen in this URLO post. As an example, -1.0_f64.cos().sin() does not trigger the lint, even though cos is not an odd function. Same goes for -1.0_f64.sin().cos() and even for -1.0_f64.cos().cos().

Clippy version: 0.0.212 (2020-08-17 792c645)

@newpavlov newpavlov added the C-bug Category: Clippy is not doing the correct thing label Aug 19, 2020
bors added a commit that referenced this issue Aug 20, 2020
Fix false positive in `PRECEDENCE` lint

Extend the lint to handle chains of methods combined with unary negation.

Closes #5924

changelog: Fix false negative in `PRECEDENCE` lint
@bors bors closed this as completed in c236c0f Aug 20, 2020
hegza pushed a commit to hegza/rust-clippy that referenced this issue Aug 25, 2020
Extend the lint to handle chains of methods combined with unary negation.

Closes rust-lang#5924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant