rust-clippy/tests/ui/needless_bool.stderr

97 lines
3.3 KiB
Text
Raw Normal View History

error: this if-then-else expression will always return true
--> $DIR/needless_bool.rs:41:5
2018-10-06 16:18:06 +00:00
|
41 | if x { true } else { true };
2018-10-06 16:18:06 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::needless-bool` implied by `-D warnings`
error: this if-then-else expression will always return false
--> $DIR/needless_bool.rs:42:5
|
42 | if x { false } else { false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this if-then-else expression returns a bool literal
--> $DIR/needless_bool.rs:43:5
|
43 | 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
--> $DIR/needless_bool.rs:44:5
|
44 | 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
--> $DIR/needless_bool.rs:45:5
|
45 | 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
--> $DIR/needless_bool.rs:60:5
|
60 | if x { return true } else { return true };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this if-then-else expression will always return false
--> $DIR/needless_bool.rs:65:5
|
65 | if x { return false } else { return false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this if-then-else expression returns a bool literal
--> $DIR/needless_bool.rs:70:5
|
70 | 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
--> $DIR/needless_bool.rs:75:5
|
75 | 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
--> $DIR/needless_bool.rs:80:5
|
80 | 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
--> $DIR/needless_bool.rs:85:5
|
85 | 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)`
error: equality checks against true are unnecessary
--> $DIR/needless_bool.rs:89:7
|
89 | if x == true { };
| ^^^^^^^^^^ help: try simplifying it as shown: `x`
|
= note: `-D clippy::bool-comparison` implied by `-D warnings`
error: equality checks against false can be replaced by a negation
--> $DIR/needless_bool.rs:93:7
|
93 | if x == false { };
| ^^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: equality checks against true are unnecessary
--> $DIR/needless_bool.rs:104:8
|
104 | if x == true { };
| ^^^^^^^^^ help: try simplifying it as shown: `x`
error: equality checks against false can be replaced by a negation
--> $DIR/needless_bool.rs:105:8
|
105 | if x == false { };
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: aborting due to 15 previous errors
2018-01-16 16:06:27 +00:00