rust/tests/ui/booleans.stderr

133 lines
3.8 KiB
Plaintext
Raw Normal View History

error: this boolean expression contains a logic bug
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:12:13
|
2017-02-08 14:58:07 +01:00
12 | let _ = a && b || a;
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^^ help: it would look like the following: `a`
|
= note: `-D logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:12:18
|
2017-02-08 14:58:07 +01:00
12 | let _ = a && b || a;
| ^
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:14:13
|
14 | let _ = !true;
2017-07-21 10:40:23 +02:00
| ^^^^^ help: try: `false`
|
= note: `-D nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:15:13
|
15 | let _ = !false;
2017-07-21 10:40:23 +02:00
| ^^^^^^ help: try: `true`
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:16:13
|
16 | let _ = !!a;
2017-07-21 10:40:23 +02:00
| ^^^ help: try: `a`
error: this boolean expression contains a logic bug
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:17:13
|
17 | let _ = false && a;
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:17:22
|
17 | let _ = false && a;
| ^
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:18:13
|
18 | let _ = false || a;
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^ help: try: `a`
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:23:13
|
23 | let _ = !(!a && b);
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^ help: try: `!b || a`
error: this boolean expression contains a logic bug
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:33:13
|
33 | let _ = a == b && a != b;
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:33:13
|
33 | let _ = a == b && a != b;
| ^^^^^^
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:34:13
|
34 | let _ = a == b && c == 5 && a == b;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
2017-07-10 15:29:29 +02:00
|
34 | let _ = a == b && c == 5;
| ^^^^^^^^^^^^^^^^
34 | let _ = !(c != 5 || a != b);
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:35:13
|
35 | let _ = a == b && c == 5 && b == a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
2017-07-10 15:29:29 +02:00
|
35 | let _ = a == b && c == 5;
| ^^^^^^^^^^^^^^^^
35 | let _ = !(c != 5 || a != b);
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression contains a logic bug
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:36:13
|
36 | let _ = a < b && a >= b;
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:36:13
|
36 | let _ = a < b && a >= b;
| ^^^^^
error: this boolean expression contains a logic bug
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:37:13
|
37 | let _ = a > b && a <= b;
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:37:13
|
37 | let _ = a > b && a <= b;
| ^^^^^
error: this boolean expression can be simplified
2017-08-01 17:54:21 +02:00
--> $DIR/booleans.rs:39:13
|
39 | let _ = a != b || !(a != b || c == d);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
2017-07-10 15:29:29 +02:00
|
39 | let _ = c != d || a != b;
| ^^^^^^^^^^^^^^^^
39 | let _ = !(a == b && c == d);
| ^^^^^^^^^^^^^^^^^^^