1
1
error: this boolean expression contains a logic bug
2
- --> $DIR/booleans.rs:11 :13
2
+ --> $DIR/booleans.rs:10 :13
3
3
|
4
4
LL | let _ = a && b || a;
5
5
| ^^^^^^^^^^^ help: it would look like the following: `a`
6
6
|
7
7
= note: `-D clippy::logic-bug` implied by `-D warnings`
8
8
help: 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
10
10
|
11
11
LL | let _ = a && b || a;
12
12
| ^
13
13
14
14
error: this boolean expression can be simplified
15
- --> $DIR/booleans.rs:13 :13
15
+ --> $DIR/booleans.rs:12 :13
16
16
|
17
17
LL | let _ = !true;
18
18
| ^^^^^ help: try: `false`
19
19
|
20
20
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
21
21
22
22
error: this boolean expression can be simplified
23
- --> $DIR/booleans.rs:14 :13
23
+ --> $DIR/booleans.rs:13 :13
24
24
|
25
25
LL | let _ = !false;
26
26
| ^^^^^^ help: try: `true`
27
27
28
28
error: this boolean expression can be simplified
29
- --> $DIR/booleans.rs:15 :13
29
+ --> $DIR/booleans.rs:14 :13
30
30
|
31
31
LL | let _ = !!a;
32
32
| ^^^ help: try: `a`
33
33
34
34
error: this boolean expression contains a logic bug
35
- --> $DIR/booleans.rs:16 :13
35
+ --> $DIR/booleans.rs:15 :13
36
36
|
37
37
LL | let _ = false && a;
38
38
| ^^^^^^^^^^ help: it would look like the following: `false`
39
39
|
40
40
help: 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
42
42
|
43
43
LL | let _ = false && a;
44
44
| ^
45
45
46
46
error: this boolean expression can be simplified
47
- --> $DIR/booleans.rs:17 :13
47
+ --> $DIR/booleans.rs:16 :13
48
48
|
49
49
LL | let _ = false || a;
50
50
| ^^^^^^^^^^ help: try: `a`
51
51
52
52
error: this boolean expression can be simplified
53
- --> $DIR/booleans.rs:22 :13
53
+ --> $DIR/booleans.rs:21 :13
54
54
|
55
55
LL | let _ = !(!a && b);
56
56
| ^^^^^^^^^^ help: try: `!b || a`
57
57
58
58
error: this boolean expression contains a logic bug
59
- --> $DIR/booleans.rs:32 :13
59
+ --> $DIR/booleans.rs:31 :13
60
60
|
61
61
LL | let _ = a == b && a != b;
62
62
| ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
63
63
|
64
64
help: 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
66
66
|
67
67
LL | let _ = a == b && a != b;
68
68
| ^^^^^^
69
69
70
70
error: this boolean expression can be simplified
71
- --> $DIR/booleans.rs:33 :13
71
+ --> $DIR/booleans.rs:32 :13
72
72
|
73
73
LL | let _ = a == b && c == 5 && a == b;
74
74
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -80,7 +80,7 @@ LL | let _ = !(c != 5 || a != b);
80
80
| ^^^^^^^^^^^^^^^^^^^
81
81
82
82
error: this boolean expression can be simplified
83
- --> $DIR/booleans.rs:34 :13
83
+ --> $DIR/booleans.rs:33 :13
84
84
|
85
85
LL | let _ = a == b && c == 5 && b == a;
86
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,31 +92,31 @@ LL | let _ = !(c != 5 || a != b);
92
92
| ^^^^^^^^^^^^^^^^^^^
93
93
94
94
error: this boolean expression contains a logic bug
95
- --> $DIR/booleans.rs:35 :13
95
+ --> $DIR/booleans.rs:34 :13
96
96
|
97
97
LL | let _ = a < b && a >= b;
98
98
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
99
99
|
100
100
help: 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
102
102
|
103
103
LL | let _ = a < b && a >= b;
104
104
| ^^^^^
105
105
106
106
error: this boolean expression contains a logic bug
107
- --> $DIR/booleans.rs:36 :13
107
+ --> $DIR/booleans.rs:35 :13
108
108
|
109
109
LL | let _ = a > b && a <= b;
110
110
| ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
111
111
|
112
112
help: 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
114
114
|
115
115
LL | let _ = a > b && a <= b;
116
116
| ^^^^^
117
117
118
118
error: this boolean expression can be simplified
119
- --> $DIR/booleans.rs:38 :13
119
+ --> $DIR/booleans.rs:37 :13
120
120
|
121
121
LL | let _ = a != b || !(a != b || c == d);
122
122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,73 +128,73 @@ LL | let _ = !(a == b && c == d);
128
128
| ^^^^^^^^^^^^^^^^^^^
129
129
130
130
error: this boolean expression can be simplified
131
- --> $DIR/booleans.rs:46 :13
131
+ --> $DIR/booleans.rs:45 :13
132
132
|
133
133
LL | let _ = !a.is_some();
134
134
| ^^^^^^^^^^^^ help: try: `a.is_none()`
135
135
136
136
error: this boolean expression can be simplified
137
- --> $DIR/booleans.rs:48 :13
137
+ --> $DIR/booleans.rs:47 :13
138
138
|
139
139
LL | let _ = !a.is_none();
140
140
| ^^^^^^^^^^^^ help: try: `a.is_some()`
141
141
142
142
error: this boolean expression can be simplified
143
- --> $DIR/booleans.rs:50 :13
143
+ --> $DIR/booleans.rs:49 :13
144
144
|
145
145
LL | let _ = !b.is_err();
146
146
| ^^^^^^^^^^^ help: try: `b.is_ok()`
147
147
148
148
error: this boolean expression can be simplified
149
- --> $DIR/booleans.rs:52 :13
149
+ --> $DIR/booleans.rs:51 :13
150
150
|
151
151
LL | let _ = !b.is_ok();
152
152
| ^^^^^^^^^^ help: try: `b.is_err()`
153
153
154
154
error: this boolean expression can be simplified
155
- --> $DIR/booleans.rs:54 :13
155
+ --> $DIR/booleans.rs:53 :13
156
156
|
157
157
LL | let _ = !(a.is_some() && !c);
158
158
| ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
159
159
160
160
error: this boolean expression can be simplified
161
- --> $DIR/booleans.rs:55 :26
161
+ --> $DIR/booleans.rs:54 :26
162
162
|
163
163
LL | let _ = !(!c ^ c) || !a.is_some();
164
164
| ^^^^^^^^^^^^ help: try: `a.is_none()`
165
165
166
166
error: this boolean expression can be simplified
167
- --> $DIR/booleans.rs:56 :25
167
+ --> $DIR/booleans.rs:55 :25
168
168
|
169
169
LL | let _ = (!c ^ c) || !a.is_some();
170
170
| ^^^^^^^^^^^^ help: try: `a.is_none()`
171
171
172
172
error: this boolean expression can be simplified
173
- --> $DIR/booleans.rs:57 :23
173
+ --> $DIR/booleans.rs:56 :23
174
174
|
175
175
LL | let _ = !c ^ c || !a.is_some();
176
176
| ^^^^^^^^^^^^ help: try: `a.is_none()`
177
177
178
178
error: this boolean expression can be simplified
179
- --> $DIR/booleans.rs:129 :8
179
+ --> $DIR/booleans.rs:128 :8
180
180
|
181
181
LL | if !res.is_ok() {}
182
182
| ^^^^^^^^^^^^ help: try: `res.is_err()`
183
183
184
184
error: this boolean expression can be simplified
185
- --> $DIR/booleans.rs:130 :8
185
+ --> $DIR/booleans.rs:129 :8
186
186
|
187
187
LL | if !res.is_err() {}
188
188
| ^^^^^^^^^^^^^ help: try: `res.is_ok()`
189
189
190
190
error: this boolean expression can be simplified
191
- --> $DIR/booleans.rs:133 :8
191
+ --> $DIR/booleans.rs:132 :8
192
192
|
193
193
LL | if !res.is_some() {}
194
194
| ^^^^^^^^^^^^^^ help: try: `res.is_none()`
195
195
196
196
error: this boolean expression can be simplified
197
- --> $DIR/booleans.rs:134 :8
197
+ --> $DIR/booleans.rs:133 :8
198
198
|
199
199
LL | if !res.is_none() {}
200
200
| ^^^^^^^^^^^^^^ help: try: `res.is_some()`
0 commit comments