More tests.

This commit is contained in:
laurent 2017-11-19 09:07:50 +00:00
parent ed202b6055
commit 41a6d015ff
2 changed files with 14 additions and 0 deletions

View file

@ -54,4 +54,6 @@ fn methods_with_negation() {
let c = false; let c = false;
let _ = !(a.is_some() && !c); let _ = !(a.is_some() && !c);
let _ = !(!c ^ c) || !a.is_some(); let _ = !(!c ^ c) || !a.is_some();
let _ = (!c ^ c) || !a.is_some();
let _ = !c ^ c || !a.is_some();
} }

View file

@ -166,3 +166,15 @@ error: this boolean expression can be simplified
56 | let _ = !(!c ^ c) || !a.is_some(); 56 | let _ = !(!c ^ c) || !a.is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(!c ^ c) || a.is_none()` | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(!c ^ c) || a.is_none()`
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()`