@@ -2,46 +2,87 @@ error: this boolean expression can be simplified
22 --> tests/ui/nonminimal_bool.rs:17:13
33 |
44LL | let _ = !true;
5- | ^^^^^ help: try: `false`
5+ | ^^^^^
66 |
77 = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
9+ help: try
10+ |
11+ LL - let _ = !true;
12+ LL + let _ = false;
13+ |
914
1015error: this boolean expression can be simplified
1116 --> tests/ui/nonminimal_bool.rs:20:13
1217 |
1318LL | let _ = !false;
14- | ^^^^^^ help: try: `true`
19+ | ^^^^^^
20+ |
21+ help: try
22+ |
23+ LL - let _ = !false;
24+ LL + let _ = true;
25+ |
1526
1627error: this boolean expression can be simplified
1728 --> tests/ui/nonminimal_bool.rs:23:13
1829 |
1930LL | let _ = !!a;
20- | ^^^ help: try: `a`
31+ | ^^^
32+ |
33+ help: try
34+ |
35+ LL - let _ = !!a;
36+ LL + let _ = a;
37+ |
2138
2239error: this boolean expression can be simplified
2340 --> tests/ui/nonminimal_bool.rs:26:13
2441 |
2542LL | let _ = false || a;
26- | ^^^^^^^^^^ help: try: `a`
43+ | ^^^^^^^^^^
44+ |
45+ help: try
46+ |
47+ LL - let _ = false || a;
48+ LL + let _ = a;
49+ |
2750
2851error: this boolean expression can be simplified
2952 --> tests/ui/nonminimal_bool.rs:32:13
3053 |
3154LL | let _ = !(!a && b);
32- | ^^^^^^^^^^ help: try: `a || !b`
55+ | ^^^^^^^^^^
56+ |
57+ help: try
58+ |
59+ LL - let _ = !(!a && b);
60+ LL + let _ = a || !b;
61+ |
3362
3463error: this boolean expression can be simplified
3564 --> tests/ui/nonminimal_bool.rs:35:13
3665 |
3766LL | let _ = !(!a || b);
38- | ^^^^^^^^^^ help: try: `a && !b`
67+ | ^^^^^^^^^^
68+ |
69+ help: try
70+ |
71+ LL - let _ = !(!a || b);
72+ LL + let _ = a && !b;
73+ |
3974
4075error: this boolean expression can be simplified
4176 --> tests/ui/nonminimal_bool.rs:38:13
4277 |
4378LL | let _ = !a && !(b && c);
44- | ^^^^^^^^^^^^^^^ help: try: `!(a || b && c)`
79+ | ^^^^^^^^^^^^^^^
80+ |
81+ help: try
82+ |
83+ LL - let _ = !a && !(b && c);
84+ LL + let _ = !(a || b && c);
85+ |
4586
4687error: this boolean expression can be simplified
4788 --> tests/ui/nonminimal_bool.rs:47:13
@@ -122,7 +163,13 @@ error: this boolean expression can be simplified
122163 --> tests/ui/nonminimal_bool.rs:90:8
123164 |
124165LL | if matches!(true, true) && true {
125- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `matches!(true, true)`
166+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167+ |
168+ help: try
169+ |
170+ LL - if matches!(true, true) && true {
171+ LL + if matches!(true, true) {
172+ |
126173
127174error: this boolean expression can be simplified
128175 --> tests/ui/nonminimal_bool.rs:171:8
@@ -215,13 +262,25 @@ error: this boolean expression can be simplified
215262 --> tests/ui/nonminimal_bool.rs:212:8
216263 |
217264LL | if !(a < 2.0 && !b) {
218- | ^^^^^^^^^^^^^^^^ help: try: `a >= 2.0 || b`
265+ | ^^^^^^^^^^^^^^^^
266+ |
267+ help: try
268+ |
269+ LL - if !(a < 2.0 && !b) {
270+ LL + if a >= 2.0 || b {
271+ |
219272
220273error: this boolean expression can be simplified
221274 --> tests/ui/nonminimal_bool.rs:231:12
222275 |
223276LL | if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
224- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr)`
277+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278+ |
279+ help: try
280+ |
281+ LL - if !(matches!(ty, TyKind::Ref(_, _, _)) && !is_mutable(&expr)) {
282+ LL + if !matches!(ty, TyKind::Ref(_, _, _)) || is_mutable(&expr) {
283+ |
225284
226285error: this boolean expression can be simplified
227286 --> tests/ui/nonminimal_bool.rs:251:8
0 commit comments