]> git.lizzy.rs Git - rust.git/blob - tests/ui/booleans.stderr
Merge pull request #3291 from JoshMcguigan/cmp_owned-3289
[rust.git] / tests / ui / booleans.stderr
1 error: this boolean expression contains a logic bug
2   --> $DIR/booleans.rs:22:13
3    |
4 22 |     let _ = a && b || a;
5    |             ^^^^^^^^^^^ help: it would look like the following: `a`
6    |
7    = note: `-D clippy::logic-bug` implied by `-D warnings`
8 help: this expression can be optimized out by applying boolean operations to the outer expression
9   --> $DIR/booleans.rs:22:18
10    |
11 22 |     let _ = a && b || a;
12    |                  ^
13
14 error: this boolean expression can be simplified
15   --> $DIR/booleans.rs:24:13
16    |
17 24 |     let _ = !true;
18    |             ^^^^^ help: try: `false`
19    |
20    = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
21
22 error: this boolean expression can be simplified
23   --> $DIR/booleans.rs:25:13
24    |
25 25 |     let _ = !false;
26    |             ^^^^^^ help: try: `true`
27
28 error: this boolean expression can be simplified
29   --> $DIR/booleans.rs:26:13
30    |
31 26 |     let _ = !!a;
32    |             ^^^ help: try: `a`
33
34 error: this boolean expression contains a logic bug
35   --> $DIR/booleans.rs:27:13
36    |
37 27 |     let _ = false && a;
38    |             ^^^^^^^^^^ help: it would look like the following: `false`
39    |
40 help: this expression can be optimized out by applying boolean operations to the outer expression
41   --> $DIR/booleans.rs:27:22
42    |
43 27 |     let _ = false && a;
44    |                      ^
45
46 error: this boolean expression can be simplified
47   --> $DIR/booleans.rs:28:13
48    |
49 28 |     let _ = false || a;
50    |             ^^^^^^^^^^ help: try: `a`
51
52 error: this boolean expression can be simplified
53   --> $DIR/booleans.rs:33:13
54    |
55 33 |     let _ = !(!a && b);
56    |             ^^^^^^^^^^ help: try: `!b || a`
57
58 error: this boolean expression contains a logic bug
59   --> $DIR/booleans.rs:43:13
60    |
61 43 |     let _ = a == b && a != b;
62    |             ^^^^^^^^^^^^^^^^ help: it would look like the following: `false`
63    |
64 help: this expression can be optimized out by applying boolean operations to the outer expression
65   --> $DIR/booleans.rs:43:13
66    |
67 43 |     let _ = a == b && a != b;
68    |             ^^^^^^
69
70 error: this boolean expression can be simplified
71   --> $DIR/booleans.rs:44:13
72    |
73 44 |     let _ = a == b && c == 5 && a == b;
74    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
75 help: try
76    |
77 44 |     let _ = a == b && c == 5;
78    |             ^^^^^^^^^^^^^^^^
79 44 |     let _ = !(c != 5 || a != b);
80    |             ^^^^^^^^^^^^^^^^^^^
81
82 error: this boolean expression can be simplified
83   --> $DIR/booleans.rs:45:13
84    |
85 45 |     let _ = a == b && c == 5 && b == a;
86    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
87 help: try
88    |
89 45 |     let _ = a == b && c == 5;
90    |             ^^^^^^^^^^^^^^^^
91 45 |     let _ = !(c != 5 || a != b);
92    |             ^^^^^^^^^^^^^^^^^^^
93
94 error: this boolean expression contains a logic bug
95   --> $DIR/booleans.rs:46:13
96    |
97 46 |     let _ = a < b && a >= b;
98    |             ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
99    |
100 help: this expression can be optimized out by applying boolean operations to the outer expression
101   --> $DIR/booleans.rs:46:13
102    |
103 46 |     let _ = a < b && a >= b;
104    |             ^^^^^
105
106 error: this boolean expression contains a logic bug
107   --> $DIR/booleans.rs:47:13
108    |
109 47 |     let _ = a > b && a <= b;
110    |             ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
111    |
112 help: this expression can be optimized out by applying boolean operations to the outer expression
113   --> $DIR/booleans.rs:47:13
114    |
115 47 |     let _ = a > b && a <= b;
116    |             ^^^^^
117
118 error: this boolean expression can be simplified
119   --> $DIR/booleans.rs:49:13
120    |
121 49 |     let _ = a != b || !(a != b || c == d);
122    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 help: try
124    |
125 49 |     let _ = c != d || a != b;
126    |             ^^^^^^^^^^^^^^^^
127 49 |     let _ = !(a == b && c == d);
128    |             ^^^^^^^^^^^^^^^^^^^
129
130 error: this boolean expression can be simplified
131   --> $DIR/booleans.rs:57:13
132    |
133 57 |     let _ = !a.is_some();
134    |             ^^^^^^^^^^^^ help: try: `a.is_none()`
135
136 error: this boolean expression can be simplified
137   --> $DIR/booleans.rs:59:13
138    |
139 59 |     let _ = !a.is_none();
140    |             ^^^^^^^^^^^^ help: try: `a.is_some()`
141
142 error: this boolean expression can be simplified
143   --> $DIR/booleans.rs:61:13
144    |
145 61 |     let _ = !b.is_err();
146    |             ^^^^^^^^^^^ help: try: `b.is_ok()`
147
148 error: this boolean expression can be simplified
149   --> $DIR/booleans.rs:63:13
150    |
151 63 |     let _ = !b.is_ok();
152    |             ^^^^^^^^^^ help: try: `b.is_err()`
153
154 error: this boolean expression can be simplified
155   --> $DIR/booleans.rs:65:13
156    |
157 65 |     let _ = !(a.is_some() && !c);
158    |             ^^^^^^^^^^^^^^^^^^^^ help: try: `c || a.is_none()`
159
160 error: this boolean expression can be simplified
161   --> $DIR/booleans.rs:66:13
162    |
163 66 |     let _ = !(!c ^ c) || !a.is_some();
164    |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(!c ^ c) || a.is_none()`
165
166 error: this boolean expression can be simplified
167   --> $DIR/booleans.rs:67:13
168    |
169 67 |     let _ = (!c ^ c) || !a.is_some();
170    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(!c ^ c) || a.is_none()`
171
172 error: this boolean expression can be simplified
173   --> $DIR/booleans.rs:68:13
174    |
175 68 |     let _ = !c ^ c || !a.is_some();
176    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `!c ^ c || a.is_none()`
177
178 error: this boolean expression can be simplified
179    --> $DIR/booleans.rs:120:8
180     |
181 120 |     if !res.is_ok() { }
182     |        ^^^^^^^^^^^^ help: try: `res.is_err()`
183
184 error: this boolean expression can be simplified
185    --> $DIR/booleans.rs:121:8
186     |
187 121 |     if !res.is_err() { }
188     |        ^^^^^^^^^^^^^ help: try: `res.is_ok()`
189
190 error: this boolean expression can be simplified
191    --> $DIR/booleans.rs:124:8
192     |
193 124 |     if !res.is_some() { }
194     |        ^^^^^^^^^^^^^^ help: try: `res.is_none()`
195
196 error: this boolean expression can be simplified
197    --> $DIR/booleans.rs:125:8
198     |
199 125 |     if !res.is_none() { }
200     |        ^^^^^^^^^^^^^^ help: try: `res.is_some()`
201
202 error: aborting due to 25 previous errors
203