2017-02-07 14:05:30 -06:00
|
|
|
error: this if-then-else expression will always return true
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:19:5
|
|
|
|
|
|
|
|
|
19 | if x { true } else { true };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-bool` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:20:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
20 | if x { false } else { false };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:21:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
21 | if x { true } else { false };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:22:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
22 | if x { false } else { true };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:23:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
23 | if x && y { false } else { true };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!(x && y)`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return true
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:35:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
35 | if x { return true } else { return true };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:40:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
40 | if x { return false } else { return false };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:45:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
45 | if x { return true } else { return false };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:50:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
50 | if x && y { return true } else { return false };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x && y`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:55:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
55 | if x { return false } else { return true };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !x`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/needless_bool.rs:60:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
60 | if x && y { return false } else { return true };
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !(x && y)`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2018-01-16 10:06:27 -06:00
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|