2020-01-13 22:41:11 +00:00
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:17:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = !true;
|
|
|
|
| ^^^^^ help: try: `false`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:20:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = !false;
|
|
|
|
| ^^^^^^ help: try: `true`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:22:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = !!a;
|
|
|
|
| ^^^ help: try: `a`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:24:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = false || a;
|
|
|
|
| ^^^^^^^^^^ help: try: `a`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:29:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = !(!a && b);
|
|
|
|
| ^^^^^^^^^^ help: try: `a || !b`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:31:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = !(!a || b);
|
|
|
|
| ^^^^^^^^^^ help: try: `a && !b`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:33:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = !a && !(b && c);
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try: `!(a || b && c)`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:42:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a == b && c == 5 && a == b;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL | let _ = !(a != b || c != 5);
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~
|
2021-10-01 18:09:31 +00:00
|
|
|
LL | let _ = a == b && c == 5;
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:44:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a == b || c == 5 || a == b;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL | let _ = !(a != b && c != 5);
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~
|
2021-10-01 18:09:31 +00:00
|
|
|
LL | let _ = a == b || c == 5;
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:46:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a == b && c == 5 && b == a;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL | let _ = !(a != b || c != 5);
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~
|
2021-10-01 18:09:31 +00:00
|
|
|
LL | let _ = a == b && c == 5;
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:48:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a != b || !(a != b || c == d);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL | let _ = !(a == b && c == d);
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~
|
2021-10-01 18:09:31 +00:00
|
|
|
LL | let _ = a != b || c != d;
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:50:13
|
2020-01-13 22:41:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = a != b && !(a != b && c == d);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
|
|
|
|
|
LL | let _ = !(a == b || c == d);
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~~~~~~~~~~~~~~~~~~~
|
2021-10-01 18:09:31 +00:00
|
|
|
LL | let _ = a != b && c != d;
|
|
|
|
| ~~~~~~~~~~~~~~~~
|
2020-01-13 22:41:11 +00:00
|
|
|
|
2022-09-21 17:02:37 +00:00
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:81:8
|
2022-09-21 17:02:37 +00:00
|
|
|
|
|
|
|
|
LL | if matches!(true, true) && true {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(true, true)`
|
|
|
|
|
2024-02-27 14:25:18 +00:00
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:161:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !(12 == a) {}
|
|
|
|
| ^^^^^^^^^^ help: try: `12 != a`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:162:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !(a == 12) {}
|
|
|
|
| ^^^^^^^^^^ help: try: `a != 12`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:163:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !(12 != a) {}
|
|
|
|
| ^^^^^^^^^^ help: try: `12 == a`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:164:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !(a != 12) {}
|
|
|
|
| ^^^^^^^^^^ help: try: `a == 12`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:168:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b == true {}
|
|
|
|
| ^^^^^^^^^^ help: try: `b != true`
|
|
|
|
|
|
|
|
error: this comparison might be written more concisely
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:168:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b == true {}
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `b != true`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::bool_comparison)]`
|
|
|
|
|
|
|
|
error: equality checks against true are unnecessary
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:168:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b == true {}
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!b`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:169:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b != true {}
|
|
|
|
| ^^^^^^^^^^ help: try: `b == true`
|
|
|
|
|
|
|
|
error: inequality checks against true can be replaced by a negation
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:169:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b != true {}
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!(!b)`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:170:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if true == !b {}
|
|
|
|
| ^^^^^^^^^^ help: try: `true != b`
|
|
|
|
|
|
|
|
error: this comparison might be written more concisely
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:170:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if true == !b {}
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `true != b`
|
|
|
|
|
|
|
|
error: equality checks against true are unnecessary
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:170:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if true == !b {}
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!b`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:171:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if true != !b {}
|
|
|
|
| ^^^^^^^^^^ help: try: `true == b`
|
|
|
|
|
|
|
|
error: inequality checks against true can be replaced by a negation
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:171:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if true != !b {}
|
|
|
|
| ^^^^^^^^^^ help: try simplifying it as shown: `!(!b)`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:172:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b == !c {}
|
|
|
|
| ^^^^^^^^ help: try: `b == c`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/nonminimal_bool.rs:173:8
|
2024-02-27 14:25:18 +00:00
|
|
|
|
|
|
|
|
LL | if !b != !c {}
|
|
|
|
| ^^^^^^^^ help: try: `b != c`
|
|
|
|
|
|
|
|
error: aborting due to 29 previous errors
|
2020-01-13 22:41:11 +00:00
|
|
|
|