2017-02-07 21:05:30 +01:00
|
|
|
error: this if-then-else expression will always return true
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:9:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
9 | if x { true } else { true };
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-05-17 14:19:44 +02:00
|
|
|
= note: `-D needless-bool` implied by `-D warnings`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:10:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-02-08 14:58:07 +01:00
|
|
|
10 | if x { false } else { false };
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:11:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
11 | if x { true } else { false };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:12:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
12 | if x { false } else { true };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:13:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
13 | if x && y { false } else { true };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!(x && y)`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression will always return true
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:25:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
25 | if x { return true } else { return true };
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression will always return false
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:30:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
30 | if x { return false } else { return false };
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:35:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
35 | if x { return true } else { return false };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:40:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
40 | if x && y { return true } else { return false };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x && y`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:45:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
45 | if x { return false } else { return true };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !x`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
error: this if-then-else expression returns a bool literal
|
2017-08-01 17:54:21 +02:00
|
|
|
--> $DIR/needless_bool.rs:50:5
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2017-05-11 15:49:12 +02:00
|
|
|
50 | if x && y { return false } else { return true };
|
2017-07-21 10:40:23 +02:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !(x && y)`
|
2017-02-07 21:05:30 +01:00
|
|
|
|