]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/needless_bool.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / needless_bool.stderr
index 638a3f56f0f288b425d83eaaa1766f981dde71ea..a0c4ae9561d4e691cc0c94f2639701c715072e1a 100644 (file)
 error: this if-then-else expression will always return true
-  --> $DIR/needless_bool.rs:41:5
+  --> $DIR/needless_bool.rs:40:5
    |
-41 |     if x { true } else { true };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | /     if x {
+LL | |         true
+LL | |     } else {
+LL | |         true
+LL | |     };
+   | |_____^
    |
    = 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
+  --> $DIR/needless_bool.rs:45:5
    |
-42 |     if x { false } else { false };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | /     if x {
+LL | |         false
+LL | |     } else {
+LL | |         false
+LL | |     };
+   | |_____^
 
 error: this if-then-else expression returns a bool literal
-  --> $DIR/needless_bool.rs:43:5
+  --> $DIR/needless_bool.rs:50:5
    |
-43 |     if x { true } else { false };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `x`
+LL | /     if x {
+LL | |         true
+LL | |     } else {
+LL | |         false
+LL | |     };
+   | |_____^ help: you can reduce it to: `x`
 
 error: this if-then-else expression returns a bool literal
-  --> $DIR/needless_bool.rs:44:5
+  --> $DIR/needless_bool.rs:55:5
    |
-44 |     if x { false } else { true };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!x`
+LL | /     if x {
+LL | |         false
+LL | |     } else {
+LL | |         true
+LL | |     };
+   | |_____^ help: you can reduce it to: `!x`
 
 error: this if-then-else expression returns a bool literal
-  --> $DIR/needless_bool.rs:45:5
+  --> $DIR/needless_bool.rs:60:5
    |
-45 |     if x && y { false } else { true };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!(x && y)`
+LL | /     if x && y {
+LL | |         false
+LL | |     } else {
+LL | |         true
+LL | |     };
+   | |_____^ help: you can reduce it to: `!(x && y)`
 
 error: this if-then-else expression will always return true
-  --> $DIR/needless_bool.rs:60:5
+  --> $DIR/needless_bool.rs:83:5
    |
-60 |     if x { return true } else { return true };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | /     if x {
+LL | |         return true;
+LL | |     } else {
+LL | |         return true;
+LL | |     };
+   | |_____^
 
 error: this if-then-else expression will always return false
-  --> $DIR/needless_bool.rs:65:5
+  --> $DIR/needless_bool.rs:92:5
    |
-65 |     if x { return false } else { return false };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | /     if x {
+LL | |         return false;
+LL | |     } else {
+LL | |         return false;
+LL | |     };
+   | |_____^
 
 error: this if-then-else expression returns a bool literal
-  --> $DIR/needless_bool.rs:70:5
+  --> $DIR/needless_bool.rs:101:5
    |
-70 |     if x { return true } else { return false };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x`
+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
-  --> $DIR/needless_bool.rs:75:5
+  --> $DIR/needless_bool.rs:110:5
    |
-75 |     if x && y { return true } else { return false };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x && y`
+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
-  --> $DIR/needless_bool.rs:80:5
+  --> $DIR/needless_bool.rs:119:5
    |
-80 |     if x { return false } else { return true };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !x`
+LL | /     if x {
+LL | |         return false;
+LL | |     } else {
+LL | |         return true;
+LL | |     };
+   | |_____^ help: you can reduce it to: `return !x`
 
 error: this if-then-else expression returns a bool literal
-  --> $DIR/needless_bool.rs:85:5
+  --> $DIR/needless_bool.rs:128:5
    |
-85 |     if x && y { return false } else { return true };
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !(x && y)`
+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
-  --> $DIR/needless_bool.rs:89:7
+  --> $DIR/needless_bool.rs:136:8
    |
-89 |    if x  == true { };
-   |       ^^^^^^^^^^ help: try simplifying it as shown: `x`
+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
-  --> $DIR/needless_bool.rs:93:7
+  --> $DIR/needless_bool.rs:140:8
    |
-93 |    if x  == false { };
-   |       ^^^^^^^^^^^ help: try simplifying it as shown: `!x`
+LL |     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`
+  --> $DIR/needless_bool.rs:150:8
+   |
+LL |     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`
+  --> $DIR/needless_bool.rs:151:8
+   |
+LL |     if x == false {};
+   |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
 
 error: aborting due to 15 previous errors