mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
More tests.
This commit is contained in:
parent
ed202b6055
commit
41a6d015ff
2 changed files with 14 additions and 0 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue