rust/tests/ui/booleans.stderr

204 lines
5.9 KiB
Plaintext
Raw Normal View History

error: this boolean expression contains a logic bug
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:19:13
|
2018-12-10 05:27:19 +00:00
19 | let _ = a && b || a;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: it would look like the following: `a`
|
= note: `-D clippy::logic-bug` implied by `-D warnings`
help: this expression can be optimized out by applying boolean operations to the outer expression
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:19:18
|
2018-12-10 05:27:19 +00:00
19 | let _ = a && b || a;
| ^
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:21:13
|
2018-12-10 05:27:19 +00:00
21 | let _ = !true;
2017-07-21 08:40:23 +00:00
| ^^^^^ help: try: `false`
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:22:13
|
2018-12-10 05:27:19 +00:00
22 | let _ = !false;
2017-07-21 08:40:23 +00:00
| ^^^^^^ help: try: `true`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:23:13
|
2018-12-10 05:27:19 +00:00
23 | let _ = !!a;
2017-07-21 08:40:23 +00:00
| ^^^ help: try: `a`
error: this boolean expression contains a logic bug
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:24:13
|
2018-12-10 05:27:19 +00:00
24 | let _ = false && a;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:24:22
|
2018-12-10 05:27:19 +00:00
24 | let _ = false && a;
| ^
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:25:13
|
2018-12-10 05:27:19 +00:00
25 | let _ = false || a;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^ help: try: `a`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:30:13
|
2018-12-10 05:27:19 +00:00
30 | let _ = !(!a && b);
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^ help: try: `!b || a`
error: this boolean expression contains a logic bug
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:40:13
|
2018-12-10 05:27:19 +00:00
40 | let _ = a == b && a != b;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:40:13
|
2018-12-10 05:27:19 +00:00
40 | let _ = a == b && a != b;
| ^^^^^^
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:41:13
|
2018-12-10 05:27:19 +00:00
41 | let _ = a == b && c == 5 && a == b;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try
2017-07-10 13:29:29 +00:00
|
2018-12-10 05:27:19 +00:00
41 | let _ = a == b && c == 5;
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^
2018-12-10 05:27:19 +00:00
41 | let _ = !(c != 5 || a != b);
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:42:13
|
2018-12-10 05:27:19 +00:00
42 | let _ = a == b && c == 5 && b == a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try
2017-07-10 13:29:29 +00:00
|
2018-12-10 05:27:19 +00:00
42 | let _ = a == b && c == 5;
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^
2018-12-10 05:27:19 +00:00
42 | let _ = !(c != 5 || a != b);
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression contains a logic bug
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:43:13
|
2018-12-10 05:27:19 +00:00
43 | let _ = a < b && a >= b;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:43:13
|
2018-12-10 05:27:19 +00:00
43 | let _ = a < b && a >= b;
| ^^^^^
error: this boolean expression contains a logic bug
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:44:13
|
2018-12-10 05:27:19 +00:00
44 | let _ = a > b && a <= b;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
|
help: this expression can be optimized out by applying boolean operations to the outer expression
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:44:13
|
2018-12-10 05:27:19 +00:00
44 | let _ = a > b && a <= b;
| ^^^^^
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:46:13
|
2018-12-10 05:27:19 +00:00
46 | let _ = a != b || !(a != b || c == d);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try
2017-07-10 13:29:29 +00:00
|
2018-12-10 05:27:19 +00:00
46 | let _ = c != d || a != b;
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^
2018-12-10 05:27:19 +00:00
46 | let _ = !(a == b && c == d);
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^^^^
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:54:13
|
2018-12-10 05:27:19 +00:00
54 | let _ = !a.is_some();
| ^^^^^^^^^^^^ help: try: `a.is_none()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:56:13
|
2018-12-10 05:27:19 +00:00
56 | let _ = !a.is_none();
| ^^^^^^^^^^^^ help: try: `a.is_some()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:58:13
|
2018-12-10 05:27:19 +00:00
58 | let _ = !b.is_err();
| ^^^^^^^^^^^ help: try: `b.is_ok()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:60:13
|
2018-12-10 05:27:19 +00:00
60 | let _ = !b.is_ok();
| ^^^^^^^^^^ help: try: `b.is_err()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:62:13
|
2018-12-10 05:27:19 +00:00
62 | let _ = !(a.is_some() && !c);
| ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
2017-11-17 21:52:11 +00:00
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:63:13
2017-11-17 21:52:11 +00:00
|
2018-12-10 05:27:19 +00:00
63 | let _ = !(!c ^ c) || !a.is_some();
2017-11-17 21:52:11 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(!c ^ c) || a.is_none()`
2017-11-19 09:07:50 +00:00
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:64:13
2017-11-19 09:07:50 +00:00
|
2018-12-10 05:27:19 +00:00
64 | let _ = (!c ^ c) || !a.is_some();
2017-11-19 09:07:50 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(!c ^ c) || a.is_none()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:65:13
2017-11-19 09:07:50 +00:00
|
2018-12-10 05:27:19 +00:00
65 | let _ = !c ^ c || !a.is_some();
2017-11-19 09:07:50 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `!c ^ c || a.is_none()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:137:8
|
2018-12-10 05:27:19 +00:00
137 | if !res.is_ok() {}
| ^^^^^^^^^^^^ help: try: `res.is_err()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:138:8
|
2018-12-10 05:27:19 +00:00
138 | if !res.is_err() {}
| ^^^^^^^^^^^^^ help: try: `res.is_ok()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:141:8
|
2018-12-10 05:27:19 +00:00
141 | if !res.is_some() {}
| ^^^^^^^^^^^^^^ help: try: `res.is_none()`
error: this boolean expression can be simplified
2018-12-10 05:27:19 +00:00
--> $DIR/booleans.rs:142:8
|
2018-12-10 05:27:19 +00:00
142 | if !res.is_none() {}
| ^^^^^^^^^^^^^^ help: try: `res.is_some()`
error: aborting due to 25 previous errors
2018-01-16 16:06:27 +00:00