]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/needless_bitwise_bool.rs
1 #![warn(clippy::needless_bitwise_bool)]
3 fn returns_bool() -> bool
{
7 const fn const_returns_bool() -> bool
{
12 let (x
, y
) = (false, true);
16 if returns_bool() & x
{
19 if !returns_bool() & returns_bool() {
26 // BELOW: lints we hope to catch as `Expr::can_have_side_effects` improves.
27 if y
& !const_returns_bool() {
28 println
!("true") // This is a const function, in an UnOp
31 if y
& "abcD".is_empty() {
32 println
!("true") // This is a const method call
36 println
!("true") // This is a BinOp with no side effects