rust-clippy/tests/ui/needless_bool.stderr

71 lines
2.4 KiB
Text
Raw Normal View History

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