11error: this boolean expression contains a logic bug
2- --> $DIR/booleans.rs:11 :13
2+ --> $DIR/booleans.rs:10 :13
33 |
44LL | let _ = a && b || a;
55 | ^^^^^^^^^^^ help: it would look like the following: `a`
66 |
77 = note: `-D clippy::logic-bug` implied by `-D warnings`
88help: this expression can be optimized out by applying boolean operations to the outer expression
9- --> $DIR/booleans.rs:11 :18
9+ --> $DIR/booleans.rs:10 :18
1010 |
1111LL | let _ = a && b || a;
1212 | ^
1313
1414error: this boolean expression can be simplified
15- --> $DIR/booleans.rs:13 :13
15+ --> $DIR/booleans.rs:12 :13
1616 |
1717LL | let _ = !true;
1818 | ^^^^^ help: try: `false`
1919 |
2020 = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
2121
2222error: this boolean expression can be simplified
23- --> $DIR/booleans.rs:14 :13
23+ --> $DIR/booleans.rs:13 :13
2424 |
2525LL | let _ = !false;
2626 | ^^^^^^ help: try: `true`
2727
2828error: this boolean expression can be simplified
29- --> $DIR/booleans.rs:15 :13
29+ --> $DIR/booleans.rs:14 :13
3030 |
3131LL | let _ = !!a;
3232 | ^^^ help: try: `a`
3333
3434error: this boolean expression contains a logic bug
35- --> $DIR/booleans.rs:16 :13
35+ --> $DIR/booleans.rs:15 :13
3636 |
3737LL | let _ = false && a;
3838 | ^^^^^^^^^^ help: it would look like the following: `false`
3939 |
4040help: this expression can be optimized out by applying boolean operations to the outer expression
41- --> $DIR/booleans.rs:16 :22
41+ --> $DIR/booleans.rs:15 :22
4242 |
4343LL | let _ = false && a;
4444 | ^
4545
4646error: this boolean expression can be simplified
47- --> $DIR/booleans.rs:17 :13
47+ --> $DIR/booleans.rs:16 :13
4848 |
4949LL | let _ = false || a;
5050 | ^^^^^^^^^^ help: try: `a`
5151
5252error: this boolean expression can be simplified
53- --> $DIR/booleans.rs:22 :13
53+ --> $DIR/booleans.rs:21 :13
5454 |
5555LL | let _ = !(!a && b);
5656 | ^^^^^^^^^^ help: try: `!b || a`
5757
5858error: this boolean expression contains a logic bug
59- --> $DIR/booleans.rs:32 :13
59+ --> $DIR/booleans.rs:31 :13
6060 |
6161LL | let _ = a == b && a != b;
6262 | ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
6363 |
6464help: this expression can be optimized out by applying boolean operations to the outer expression
65- --> $DIR/booleans.rs:32 :13
65+ --> $DIR/booleans.rs:31 :13
6666 |
6767LL | let _ = a == b && a != b;
6868 | ^^^^^^
6969
7070error: this boolean expression can be simplified
71- --> $DIR/booleans.rs:33 :13
71+ --> $DIR/booleans.rs:32 :13
7272 |
7373LL | let _ = a == b && c == 5 && a == b;
7474 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -80,7 +80,7 @@ LL | let _ = !(c != 5 || a != b);
8080 | ^^^^^^^^^^^^^^^^^^^
8181
8282error: this boolean expression can be simplified
83- --> $DIR/booleans.rs:34 :13
83+ --> $DIR/booleans.rs:33 :13
8484 |
8585LL | let _ = a == b && c == 5 && b == a;
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,31 +92,31 @@ LL | let _ = !(c != 5 || a != b);
9292 | ^^^^^^^^^^^^^^^^^^^
9393
9494error: this boolean expression contains a logic bug
95- --> $DIR/booleans.rs:35 :13
95+ --> $DIR/booleans.rs:34 :13
9696 |
9797LL | let _ = a < b && a >= b;
9898 | ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
9999 |
100100help: this expression can be optimized out by applying boolean operations to the outer expression
101- --> $DIR/booleans.rs:35 :13
101+ --> $DIR/booleans.rs:34 :13
102102 |
103103LL | let _ = a < b && a >= b;
104104 | ^^^^^
105105
106106error: this boolean expression contains a logic bug
107- --> $DIR/booleans.rs:36 :13
107+ --> $DIR/booleans.rs:35 :13
108108 |
109109LL | let _ = a > b && a <= b;
110110 | ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
111111 |
112112help: this expression can be optimized out by applying boolean operations to the outer expression
113- --> $DIR/booleans.rs:36 :13
113+ --> $DIR/booleans.rs:35 :13
114114 |
115115LL | let _ = a > b && a <= b;
116116 | ^^^^^
117117
118118error: this boolean expression can be simplified
119- --> $DIR/booleans.rs:38 :13
119+ --> $DIR/booleans.rs:37 :13
120120 |
121121LL | let _ = a != b || !(a != b || c == d);
122122 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,73 +128,73 @@ LL | let _ = !(a == b && c == d);
128128 | ^^^^^^^^^^^^^^^^^^^
129129
130130error: this boolean expression can be simplified
131- --> $DIR/booleans.rs:46 :13
131+ --> $DIR/booleans.rs:45 :13
132132 |
133133LL | let _ = !a.is_some();
134134 | ^^^^^^^^^^^^ help: try: `a.is_none()`
135135
136136error: this boolean expression can be simplified
137- --> $DIR/booleans.rs:48 :13
137+ --> $DIR/booleans.rs:47 :13
138138 |
139139LL | let _ = !a.is_none();
140140 | ^^^^^^^^^^^^ help: try: `a.is_some()`
141141
142142error: this boolean expression can be simplified
143- --> $DIR/booleans.rs:50 :13
143+ --> $DIR/booleans.rs:49 :13
144144 |
145145LL | let _ = !b.is_err();
146146 | ^^^^^^^^^^^ help: try: `b.is_ok()`
147147
148148error: this boolean expression can be simplified
149- --> $DIR/booleans.rs:52 :13
149+ --> $DIR/booleans.rs:51 :13
150150 |
151151LL | let _ = !b.is_ok();
152152 | ^^^^^^^^^^ help: try: `b.is_err()`
153153
154154error: this boolean expression can be simplified
155- --> $DIR/booleans.rs:54 :13
155+ --> $DIR/booleans.rs:53 :13
156156 |
157157LL | let _ = !(a.is_some() && !c);
158158 | ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
159159
160160error: this boolean expression can be simplified
161- --> $DIR/booleans.rs:55 :26
161+ --> $DIR/booleans.rs:54 :26
162162 |
163163LL | let _ = !(!c ^ c) || !a.is_some();
164164 | ^^^^^^^^^^^^ help: try: `a.is_none()`
165165
166166error: this boolean expression can be simplified
167- --> $DIR/booleans.rs:56 :25
167+ --> $DIR/booleans.rs:55 :25
168168 |
169169LL | let _ = (!c ^ c) || !a.is_some();
170170 | ^^^^^^^^^^^^ help: try: `a.is_none()`
171171
172172error: this boolean expression can be simplified
173- --> $DIR/booleans.rs:57 :23
173+ --> $DIR/booleans.rs:56 :23
174174 |
175175LL | let _ = !c ^ c || !a.is_some();
176176 | ^^^^^^^^^^^^ help: try: `a.is_none()`
177177
178178error: this boolean expression can be simplified
179- --> $DIR/booleans.rs:129 :8
179+ --> $DIR/booleans.rs:128 :8
180180 |
181181LL | if !res.is_ok() {}
182182 | ^^^^^^^^^^^^ help: try: `res.is_err()`
183183
184184error: this boolean expression can be simplified
185- --> $DIR/booleans.rs:130 :8
185+ --> $DIR/booleans.rs:129 :8
186186 |
187187LL | if !res.is_err() {}
188188 | ^^^^^^^^^^^^^ help: try: `res.is_ok()`
189189
190190error: this boolean expression can be simplified
191- --> $DIR/booleans.rs:133 :8
191+ --> $DIR/booleans.rs:132 :8
192192 |
193193LL | if !res.is_some() {}
194194 | ^^^^^^^^^^^^^^ help: try: `res.is_none()`
195195
196196error: this boolean expression can be simplified
197- --> $DIR/booleans.rs:134 :8
197+ --> $DIR/booleans.rs:133 :8
198198 |
199199LL | if !res.is_none() {}
200200 | ^^^^^^^^^^^^^^ help: try: `res.is_some()`
0 commit comments