2017-02-07 14:05:30 -06:00
|
|
|
error: this boolean expression contains a logic bug
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:12:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
12 | let _ = a && b || a;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^ help: it would look like the following: `a`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-17 07:19:44 -05:00
|
|
|
= note: `-D logic-bug` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:12:18
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
12 | let _ = a && b || a;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:14:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
14 | let _ = !true;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^ help: try: `false`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-17 07:19:44 -05:00
|
|
|
= note: `-D nonminimal-bool` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:15:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
15 | let _ = !false;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^ help: try: `true`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:16:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
16 | let _ = !!a;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^ help: try: `a`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:17:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
17 | let _ = false && a;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^ help: it would look like the following: `false`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:17:22
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
17 | let _ = false && a;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:18:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
18 | let _ = false || a;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^ help: try: `a`
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:23:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
23 | let _ = !(!a && b);
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^ help: try: `!b || a`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:33:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
33 | let _ = a == b && a != b;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:33:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
33 | let _ = a == b && a != b;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:34:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
34 | let _ = a == b && c == 5 && a == b;
|
2017-05-14 02:56:10 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try
|
2017-07-10 08:29:29 -05:00
|
|
|
|
|
|
|
|
34 | let _ = a == b && c == 5;
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
34 | let _ = !(c != 5 || a != b);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:35:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
35 | let _ = a == b && c == 5 && b == a;
|
2017-05-14 02:56:10 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try
|
2017-07-10 08:29:29 -05:00
|
|
|
|
|
|
|
|
35 | let _ = a == b && c == 5;
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
35 | let _ = !(c != 5 || a != b);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:36:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
36 | let _ = a < b && a >= b;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:36:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
36 | let _ = a < b && a >= b;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: this boolean expression contains a logic bug
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:37:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
37 | let _ = a > b && a <= b;
|
2017-07-21 03:40:23 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
help: this expression can be optimized out by applying boolean operations to the outer expression
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:37:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
37 | let _ = a > b && a <= b;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
2017-08-01 10:54:21 -05:00
|
|
|
--> $DIR/booleans.rs:39:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2017-05-10 10:07:54 -05:00
|
|
|
39 | let _ = a != b || !(a != b || c == d);
|
2017-05-14 02:56:10 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
help: try
|
2017-07-10 08:29:29 -05:00
|
|
|
|
|
|
|
|
39 | let _ = c != d || a != b;
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
39 | let _ = !(a == b && c == d);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2017-11-14 15:14:08 -06:00
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:47:13
|
|
|
|
|
|
|
|
|
47 | let _ = !a.is_some();
|
|
|
|
| ^^^^^^^^^^^^ help: try: `a.is_none()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:49:13
|
|
|
|
|
|
|
|
|
49 | let _ = !a.is_none();
|
|
|
|
| ^^^^^^^^^^^^ help: try: `a.is_some()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:51:13
|
|
|
|
|
|
|
|
|
51 | let _ = !b.is_err();
|
|
|
|
| ^^^^^^^^^^^ help: try: `b.is_ok()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:53:13
|
|
|
|
|
|
|
|
|
53 | let _ = !b.is_ok();
|
|
|
|
| ^^^^^^^^^^ help: try: `b.is_err()`
|
|
|
|
|
2017-11-07 15:43:24 -06:00
|
|
|
error: this boolean expression can be simplified
|
2017-11-14 10:07:04 -06:00
|
|
|
--> $DIR/booleans.rs:55:13
|
2017-11-07 15:43:24 -06:00
|
|
|
|
|
2017-11-14 10:07:04 -06:00
|
|
|
55 | let _ = !(a.is_some() && !c);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
|
2017-11-07 15:43:24 -06:00
|
|
|
|
2017-11-17 15:52:11 -06:00
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:56:13
|
|
|
|
|
|
|
|
|
56 | let _ = !(!c ^ c) || !a.is_some();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(!c ^ c) || a.is_none()`
|
|
|
|
|
2017-11-19 03:07:50 -06:00
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:57:13
|
|
|
|
|
|
|
|
|
57 | let _ = (!c ^ c) || !a.is_some();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(!c ^ c) || a.is_none()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:58:13
|
|
|
|
|
|
|
|
|
58 | let _ = !c ^ c || !a.is_some();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `!c ^ c || a.is_none()`
|
|
|
|
|
2018-04-07 05:52:18 -05:00
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:110:8
|
|
|
|
|
|
|
|
|
110 | if !res.is_ok() { }
|
|
|
|
| ^^^^^^^^^^^^ help: try: `res.is_err()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:111:8
|
|
|
|
|
|
|
|
|
111 | if !res.is_err() { }
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `res.is_ok()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:114:8
|
|
|
|
|
|
|
|
|
114 | if !res.is_some() { }
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `res.is_none()`
|
|
|
|
|
|
|
|
error: this boolean expression can be simplified
|
|
|
|
--> $DIR/booleans.rs:115:8
|
|
|
|
|
|
|
|
|
115 | if !res.is_none() { }
|
|
|
|
| ^^^^^^^^^^^^^^ help: try: `res.is_some()`
|
|
|
|
|
|
|
|
error: aborting due to 25 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|