mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
117 lines
3.1 KiB
Text
117 lines
3.1 KiB
Text
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:13:13
|
|
|
|
|
LL | let _ = !true;
|
|
| ^^^^^ help: try: `false`
|
|
|
|
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:16:13
|
|
|
|
|
LL | let _ = !false;
|
|
| ^^^^^^ help: try: `true`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:18:13
|
|
|
|
|
LL | let _ = !!a;
|
|
| ^^^ help: try: `a`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:20:13
|
|
|
|
|
LL | let _ = false || a;
|
|
| ^^^^^^^^^^ help: try: `a`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:25:13
|
|
|
|
|
LL | let _ = !(!a && b);
|
|
| ^^^^^^^^^^ help: try: `a || !b`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:27:13
|
|
|
|
|
LL | let _ = !(!a || b);
|
|
| ^^^^^^^^^^ help: try: `a && !b`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:29:13
|
|
|
|
|
LL | let _ = !a && !(b && c);
|
|
| ^^^^^^^^^^^^^^^ help: try: `!(a || b && c)`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:38:13
|
|
|
|
|
LL | let _ = a == b && c == 5 && a == b;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try
|
|
|
|
|
LL | let _ = !(a != b || c != 5);
|
|
| ~~~~~~~~~~~~~~~~~~~
|
|
LL | let _ = a == b && c == 5;
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:40:13
|
|
|
|
|
LL | let _ = a == b || c == 5 || a == b;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try
|
|
|
|
|
LL | let _ = !(a != b && c != 5);
|
|
| ~~~~~~~~~~~~~~~~~~~
|
|
LL | let _ = a == b || c == 5;
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:42:13
|
|
|
|
|
LL | let _ = a == b && c == 5 && b == a;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try
|
|
|
|
|
LL | let _ = !(a != b || c != 5);
|
|
| ~~~~~~~~~~~~~~~~~~~
|
|
LL | let _ = a == b && c == 5;
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:44:13
|
|
|
|
|
LL | let _ = a != b || !(a != b || c == d);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try
|
|
|
|
|
LL | let _ = !(a == b && c == d);
|
|
| ~~~~~~~~~~~~~~~~~~~
|
|
LL | let _ = a != b || c != d;
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:46:13
|
|
|
|
|
LL | let _ = a != b && !(a != b && c == d);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try
|
|
|
|
|
LL | let _ = !(a == b || c == d);
|
|
| ~~~~~~~~~~~~~~~~~~~
|
|
LL | let _ = a != b && c != d;
|
|
| ~~~~~~~~~~~~~~~~
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/nonminimal_bool.rs:77:8
|
|
|
|
|
LL | if matches!(true, true) && true {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(true, true)`
|
|
|
|
error: aborting due to 13 previous errors
|
|
|