rust-clippy/tests/ui/needless_bool
Andre Bogus 4a39707795 Parenthesize blocks in needless_bool suggestion
Because the `if .. {}` statement already puts the condition in
expression scope, contained blocks would be parsed as complete
statements, so any `&` binary expression whose left operand ended in a
block would lead to a non-compiling suggestion.

This adds a visitor to identify such expressions and add parentheses.

This fixes #8052.
2021-12-06 13:15:31 +01:00
..
fixable.fixed Parenthesize blocks in needless_bool suggestion 2021-12-06 13:15:31 +01:00
fixable.rs Parenthesize blocks in needless_bool suggestion 2021-12-06 13:15:31 +01:00
fixable.stderr Parenthesize blocks in needless_bool suggestion 2021-12-06 13:15:31 +01:00
simple.rs Renaming the lint to branches_sharing_code and fixing typos 2021-04-05 13:35:51 +02:00
simple.stderr Moving shared_code_in_if_blocks to clippy::complexity and running lintcheck 2021-04-05 13:35:51 +02:00