2017-02-07 20:05:30 +00:00
|
|
|
error: this if-then-else expression will always return true
|
|
|
|
--> $DIR/needless_bool.rs:9:5
|
|
|
|
|
|
2017-02-08 13:58:07 +00:00
|
|
|
9 | if x { true } else { true };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/needless_bool.rs:3:9
|
|
|
|
|
|
|
|
|
3 | #![deny(needless_bool)]
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
|
|
|
--> $DIR/needless_bool.rs:10:5
|
|
|
|
|
|
2017-02-08 13:58:07 +00:00
|
|
|
10 | if x { false } else { false };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:11:5
|
|
|
|
|
|
|
|
|
11 | if x { true } else { false };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:15:5
|
|
|
|
|
|
|
|
|
15 | if x { false } else { true };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:19:5
|
|
|
|
|
|
|
|
|
19 | if x && y { false } else { true };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!(x && y)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return true
|
|
|
|
--> $DIR/needless_bool.rs:34:5
|
|
|
|
|
|
|
|
|
34 | if x { return true } else { return true };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
|
|
|
--> $DIR/needless_bool.rs:40:5
|
|
|
|
|
|
|
|
|
40 | if x { return false } else { return false };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:46:5
|
|
|
|
|
|
|
|
|
46 | if x { return true } else { return false };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:54:5
|
|
|
|
|
|
|
|
|
54 | if x && y { return true } else { return false };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x && y`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:62:5
|
|
|
|
|
|
|
|
|
62 | if x { return false } else { return true };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !x`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
|
|
|
--> $DIR/needless_bool.rs:70:5
|
|
|
|
|
|
|
|
|
70 | if x && y { return false } else { return true };
|
2017-05-03 10:51:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !(x && y)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|