@@ -53,22 +53,28 @@ error: this boolean expression can be simplified
5353 --> $DIR/booleans.rs:21:13
5454 |
5555LL | let _ = !(!a && b);
56- | ^^^^^^^^^^ help: try: `!b || a`
56+ | ^^^^^^^^^^ help: try: `a || !b`
57+
58+ error: this boolean expression can be simplified
59+ --> $DIR/booleans.rs:22:13
60+ |
61+ LL | let _ = !(!a || b);
62+ | ^^^^^^^^^^ help: try: `a && !b`
5763
5864error: this boolean expression contains a logic bug
59- --> $DIR/booleans.rs:31 :13
65+ --> $DIR/booleans.rs:32 :13
6066 |
6167LL | let _ = a == b && a != b;
6268 | ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
6369 |
6470help: this expression can be optimized out by applying boolean operations to the outer expression
65- --> $DIR/booleans.rs:31 :13
71+ --> $DIR/booleans.rs:32 :13
6672 |
6773LL | let _ = a == b && a != b;
6874 | ^^^^^^
6975
7076error: this boolean expression can be simplified
71- --> $DIR/booleans.rs:32 :13
77+ --> $DIR/booleans.rs:33 :13
7278 |
7379LL | let _ = a == b && c == 5 && a == b;
7480 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -77,11 +83,24 @@ help: try
7783 |
7884LL | let _ = a == b && c == 5;
7985 | ^^^^^^^^^^^^^^^^
80- LL | let _ = !(c != 5 || a != b );
86+ LL | let _ = !(a != b || c != 5 );
8187 | ^^^^^^^^^^^^^^^^^^^
8288
8389error: this boolean expression can be simplified
84- --> $DIR/booleans.rs:33:13
90+ --> $DIR/booleans.rs:34:13
91+ |
92+ LL | let _ = a == b || c == 5 || a == b;
93+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
94+ |
95+ help: try
96+ |
97+ LL | let _ = a == b || c == 5;
98+ | ^^^^^^^^^^^^^^^^
99+ LL | let _ = !(a != b && c != 5);
100+ | ^^^^^^^^^^^^^^^^^^^
101+
102+ error: this boolean expression can be simplified
103+ --> $DIR/booleans.rs:35:13
85104 |
86105LL | let _ = a == b && c == 5 && b == a;
87106 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -90,117 +109,136 @@ help: try
90109 |
91110LL | let _ = a == b && c == 5;
92111 | ^^^^^^^^^^^^^^^^
93- LL | let _ = !(c != 5 || a != b );
112+ LL | let _ = !(a != b || c != 5 );
94113 | ^^^^^^^^^^^^^^^^^^^
95114
96115error: this boolean expression contains a logic bug
97- --> $DIR/booleans.rs:34 :13
116+ --> $DIR/booleans.rs:36 :13
98117 |
99118LL | let _ = a < b && a >= b;
100119 | ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
101120 |
102121help: this expression can be optimized out by applying boolean operations to the outer expression
103- --> $DIR/booleans.rs:34 :13
122+ --> $DIR/booleans.rs:36 :13
104123 |
105124LL | let _ = a < b && a >= b;
106125 | ^^^^^
107126
108127error: this boolean expression contains a logic bug
109- --> $DIR/booleans.rs:35 :13
128+ --> $DIR/booleans.rs:37 :13
110129 |
111130LL | let _ = a > b && a <= b;
112131 | ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
113132 |
114133help: this expression can be optimized out by applying boolean operations to the outer expression
115- --> $DIR/booleans.rs:35 :13
134+ --> $DIR/booleans.rs:37 :13
116135 |
117136LL | let _ = a > b && a <= b;
118137 | ^^^^^
119138
120139error: this boolean expression can be simplified
121- --> $DIR/booleans.rs:37 :13
140+ --> $DIR/booleans.rs:39 :13
122141 |
123142LL | let _ = a != b || !(a != b || c == d);
124143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125144 |
126145help: try
127146 |
128- LL | let _ = c != d || a != b ;
147+ LL | let _ = a != b || c != d ;
129148 | ^^^^^^^^^^^^^^^^
130149LL | let _ = !(a == b && c == d);
131150 | ^^^^^^^^^^^^^^^^^^^
132151
133152error: this boolean expression can be simplified
134- --> $DIR/booleans.rs:45:13
153+ --> $DIR/booleans.rs:40:13
154+ |
155+ LL | let _ = a != b && !(a != b && c == d);
156+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157+ |
158+ help: try
159+ |
160+ LL | let _ = a != b && c != d;
161+ | ^^^^^^^^^^^^^^^^
162+ LL | let _ = !(a == b || c == d);
163+ | ^^^^^^^^^^^^^^^^^^^
164+
165+ error: this boolean expression can be simplified
166+ --> $DIR/booleans.rs:48:13
135167 |
136168LL | let _ = !a.is_some();
137169 | ^^^^^^^^^^^^ help: try: `a.is_none()`
138170
139171error: this boolean expression can be simplified
140- --> $DIR/booleans.rs:47 :13
172+ --> $DIR/booleans.rs:50 :13
141173 |
142174LL | let _ = !a.is_none();
143175 | ^^^^^^^^^^^^ help: try: `a.is_some()`
144176
145177error: this boolean expression can be simplified
146- --> $DIR/booleans.rs:49 :13
178+ --> $DIR/booleans.rs:52 :13
147179 |
148180LL | let _ = !b.is_err();
149181 | ^^^^^^^^^^^ help: try: `b.is_ok()`
150182
151183error: this boolean expression can be simplified
152- --> $DIR/booleans.rs:51 :13
184+ --> $DIR/booleans.rs:54 :13
153185 |
154186LL | let _ = !b.is_ok();
155187 | ^^^^^^^^^^ help: try: `b.is_err()`
156188
157189error: this boolean expression can be simplified
158- --> $DIR/booleans.rs:53 :13
190+ --> $DIR/booleans.rs:56 :13
159191 |
160192LL | let _ = !(a.is_some() && !c);
161- | ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
193+ | ^^^^^^^^^^^^^^^^^^^^ help: try: `a.is_none() || c`
194+
195+ error: this boolean expression can be simplified
196+ --> $DIR/booleans.rs:57:13
197+ |
198+ LL | let _ = !(a.is_some() || !c);
199+ | ^^^^^^^^^^^^^^^^^^^^ help: try: `a.is_none() && c`
162200
163201error: this boolean expression can be simplified
164- --> $DIR/booleans.rs:54 :26
202+ --> $DIR/booleans.rs:58 :26
165203 |
166204LL | let _ = !(!c ^ c) || !a.is_some();
167205 | ^^^^^^^^^^^^ help: try: `a.is_none()`
168206
169207error: this boolean expression can be simplified
170- --> $DIR/booleans.rs:55 :25
208+ --> $DIR/booleans.rs:59 :25
171209 |
172210LL | let _ = (!c ^ c) || !a.is_some();
173211 | ^^^^^^^^^^^^ help: try: `a.is_none()`
174212
175213error: this boolean expression can be simplified
176- --> $DIR/booleans.rs:56 :23
214+ --> $DIR/booleans.rs:60 :23
177215 |
178216LL | let _ = !c ^ c || !a.is_some();
179217 | ^^^^^^^^^^^^ help: try: `a.is_none()`
180218
181219error: this boolean expression can be simplified
182- --> $DIR/booleans.rs:128 :8
220+ --> $DIR/booleans.rs:132 :8
183221 |
184222LL | if !res.is_ok() {}
185223 | ^^^^^^^^^^^^ help: try: `res.is_err()`
186224
187225error: this boolean expression can be simplified
188- --> $DIR/booleans.rs:129 :8
226+ --> $DIR/booleans.rs:133 :8
189227 |
190228LL | if !res.is_err() {}
191229 | ^^^^^^^^^^^^^ help: try: `res.is_ok()`
192230
193231error: this boolean expression can be simplified
194- --> $DIR/booleans.rs:132 :8
232+ --> $DIR/booleans.rs:136 :8
195233 |
196234LL | if !res.is_some() {}
197235 | ^^^^^^^^^^^^^^ help: try: `res.is_none()`
198236
199237error: this boolean expression can be simplified
200- --> $DIR/booleans.rs:133 :8
238+ --> $DIR/booleans.rs:137 :8
201239 |
202240LL | if !res.is_none() {}
203241 | ^^^^^^^^^^^^^^ help: try: `res.is_some()`
204242
205- error: aborting due to 25 previous errors
243+ error: aborting due to 29 previous errors
206244
0 commit comments