mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
121 lines
3.6 KiB
Text
121 lines
3.6 KiB
Text
error: this boolean expression contains a logic bug
|
|
--> $DIR/booleans.rs:12:13
|
|
|
|
|
12 | let _ = a && b || a;
|
|
| ^^^^^^^^^^^ help: it would look like the following `a`
|
|
|
|
|
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
|
|
|
|
|
12 | let _ = a && b || a;
|
|
| ^
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:17:13
|
|
|
|
|
17 | let _ = !true;
|
|
| ^^^^^ help: try `false`
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/booleans.rs:3:9
|
|
|
|
|
3 | #![deny(nonminimal_bool, logic_bug)]
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:20:13
|
|
|
|
|
20 | let _ = !false;
|
|
| ^^^^^^ help: try `true`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:23:13
|
|
|
|
|
23 | let _ = !!a;
|
|
| ^^^ help: try `a`
|
|
|
|
error: this boolean expression contains a logic bug
|
|
--> $DIR/booleans.rs:27:13
|
|
|
|
|
27 | let _ = false && a;
|
|
| ^^^^^^^^^^ help: it would look like the following `false`
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
|
--> $DIR/booleans.rs:27:22
|
|
|
|
|
27 | let _ = false && a;
|
|
| ^
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:32:13
|
|
|
|
|
32 | let _ = false || a;
|
|
| ^^^^^^^^^^ help: try `a`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:43:13
|
|
|
|
|
43 | let _ = !(!a && b);
|
|
| ^^^^^^^^^^ help: try `!b || a`
|
|
|
|
error: this boolean expression contains a logic bug
|
|
--> $DIR/booleans.rs:55:13
|
|
|
|
|
55 | let _ = a == b && a != b;
|
|
| ^^^^^^^^^^^^^^^^ help: it would look like the following `false`
|
|
|
|
|
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;
|
|
| ^^^^^^
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:60:13
|
|
|
|
|
60 | let _ = a == b && c == 5 && a == b;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `a == b && c == 5`
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:66:13
|
|
|
|
|
66 | let _ = a == b && c == 5 && b == a;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `a == b && c == 5`
|
|
|
|
error: this boolean expression contains a logic bug
|
|
--> $DIR/booleans.rs:72:13
|
|
|
|
|
72 | let _ = a < b && a >= b;
|
|
| ^^^^^^^^^^^^^^^ help: it would look like the following `false`
|
|
|
|
|
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;
|
|
| ^^^^^
|
|
|
|
error: this boolean expression contains a logic bug
|
|
--> $DIR/booleans.rs:77:13
|
|
|
|
|
77 | let _ = a > b && a <= b;
|
|
| ^^^^^^^^^^^^^^^ help: it would look like the following `false`
|
|
|
|
|
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;
|
|
| ^^^^^
|
|
|
|
error: this boolean expression can be simplified
|
|
--> $DIR/booleans.rs:84:13
|
|
|
|
|
84 | let _ = a != b || !(a != b || c == d);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `c != d || a != b`
|
|
|
|
error: aborting due to 13 previous errors
|
|
|