2017-02-07 21:05:30 +01:00
|
|
|
error: this boolean expression contains a logic bug
|
|
|
|
--> $DIR/booleans.rs:12:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
12 | let _ = a && b || a;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/booleans.rs:3:26
|
|
|
|
|
|
|
|
|
3 | #![deny(nonminimal_bool, logic_bug)]
|
|
|
|
| ^^^^^^^^^
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
|
|
|
--> $DIR/booleans.rs:12:18
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
12 | let _ = a && b || a;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
help: it would look like the following
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = a;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:17:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
17 | let _ = !true;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/booleans.rs:3:9
|
|
|
|
|
|
|
|
|
3 | #![deny(nonminimal_bool, logic_bug)]
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
help: try
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = false;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:20:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
20 | let _ = !false;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = true;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:23:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
23 | let _ = !!a;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
help: try
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = a;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
|
|
|
--> $DIR/booleans.rs:27:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
27 | let _ = false && a;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
|
|
|
--> $DIR/booleans.rs:27:22
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
27 | let _ = false && a;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
help: it would look like the following
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = false;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:32:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
32 | let _ = false || a;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = a;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:43:13
|
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
43 | let _ = !(!a && b);
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
2017-02-08 14:58:07 +01:00
|
|
|
| let _ = !b || a;
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
|
|
|
--> $DIR/booleans.rs:55:13
|
|
|
|
|
|
|
|
|
55 | let _ = a == b && a != b;
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
|
|
|
--> $DIR/booleans.rs:55:13
|
|
|
|
|
|
|
|
|
55 | let _ = a == b && a != b;
|
|
|
|
| ^^^^^^
|
|
|
|
help: it would look like the following
|
|
|
|
| let _ = false;
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:60:13
|
|
|
|
|
|
|
|
|
60 | let _ = a == b && c == 5 && a == b;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| let _ = a == b && c == 5;
|
|
|
|
help: try
|
|
|
|
| let _ = !(c != 5 || a != b);
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:66:13
|
|
|
|
|
|
|
|
|
66 | let _ = a == b && c == 5 && b == a;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| let _ = a == b && c == 5;
|
|
|
|
help: try
|
|
|
|
| let _ = !(c != 5 || a != b);
|
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
|
|
|
--> $DIR/booleans.rs:72:13
|
|
|
|
|
|
|
|
|
72 | let _ = a < b && a >= b;
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
|
|
|
--> $DIR/booleans.rs:72:13
|
|
|
|
|
|
|
|
|
72 | let _ = a < b && a >= b;
|
|
|
|
| ^^^^^
|
|
|
|
help: it would look like the following
|
|
|
|
| let _ = false;
|
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
|
|
|
--> $DIR/booleans.rs:77:13
|
|
|
|
|
|
|
|
|
77 | let _ = a > b && a <= b;
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
|
|
|
--> $DIR/booleans.rs:77:13
|
|
|
|
|
|
|
|
|
77 | let _ = a > b && a <= b;
|
|
|
|
| ^^^^^
|
|
|
|
help: it would look like the following
|
|
|
|
| let _ = false;
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:84:13
|
|
|
|
|
|
|
|
|
84 | let _ = a != b || !(a != b || c == d);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: try
|
|
|
|
| let _ = c != d || a != b;
|
|
|
|
help: try
|
|
|
|
| let _ = !(a == b && c == d);
|
|
|
|
|
|
|
|
error: aborting due to 13 previous errors
|
|
|
|
|