rust/tests/ui/needless_bool/fixable.stderr

112 lines
2.9 KiB
Plaintext
Raw Normal View History

error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:40:5
|
2018-12-27 09:57:55 -06:00
LL | / if x {
LL | | true
LL | | } else {
LL | | false
LL | | };
2018-12-09 23:27:19 -06:00
| |_____^ help: you can reduce it to: `x`
|
= note: `-D clippy::needless-bool` implied by `-D warnings`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:45:5
|
2018-12-27 09:57:55 -06:00
LL | / if x {
LL | | false
LL | | } else {
LL | | true
LL | | };
2018-12-09 23:27:19 -06:00
| |_____^ help: you can reduce it to: `!x`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:50:5
|
2018-12-27 09:57:55 -06:00
LL | / if x && y {
LL | | false
LL | | } else {
LL | | true
LL | | };
2018-12-09 23:27:19 -06:00
| |_____^ help: you can reduce it to: `!(x && y)`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:70:5
|
2018-12-27 09:57:55 -06:00
LL | / if x {
LL | | return true;
LL | | } else {
LL | | return false;
LL | | };
| |_____^ help: you can reduce it to: `return x`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:78:5
2018-12-27 09:57:55 -06:00
|
LL | / if x {
LL | | return false;
LL | | } else {
LL | | return true;
2018-12-27 09:57:55 -06:00
LL | | };
| |_____^ help: you can reduce it to: `return !x`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:86:5
2018-12-27 09:57:55 -06:00
|
LL | / if x && y {
LL | | return true;
LL | | } else {
LL | | return false;
LL | | };
| |_____^ help: you can reduce it to: `return x && y`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:94:5
2018-12-27 09:57:55 -06:00
|
LL | / if x && y {
LL | | return false;
LL | | } else {
LL | | return true;
LL | | };
| |_____^ help: you can reduce it to: `return !(x && y)`
error: equality checks against true are unnecessary
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:102:8
2018-12-27 09:57:55 -06:00
|
LL | 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
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:106:8
2018-12-27 09:57:55 -06:00
|
LL | if x == false {};
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: equality checks against true are unnecessary
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:116:8
2018-12-27 09:57:55 -06:00
|
LL | if x == true {};
| ^^^^^^^^^ help: try simplifying it as shown: `x`
error: equality checks against false can be replaced by a negation
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:117:8
2018-12-27 09:57:55 -06:00
|
LL | if x == false {};
| ^^^^^^^^^^ help: try simplifying it as shown: `!x`
error: this if-then-else expression returns a bool literal
2021-06-25 15:34:45 -05:00
--> $DIR/fixable.rs:126:12
|
LL | } else if returns_bool() {
| ____________^
LL | | false
LL | | } else {
LL | | true
LL | | };
| |_____^ help: you can reduce it to: `{ !returns_bool() }`
error: aborting due to 12 previous errors
2018-01-16 10:06:27 -06:00