]> git.lizzy.rs Git - rust.git/blob - tests/ui/booleans.stderr
Reduce the hackiness of cargo-clippy
[rust.git] / tests / ui / booleans.stderr
1 error: this boolean expression contains a logic bug
2   --> $DIR/booleans.rs:12:13
3    |
4 12 |     let _ = a && b || a;
5    |             ^^^^^^^^^^^ help: it would look like the following: `a`
6    |
7    = note: `-D 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:12:18
10    |
11 12 |     let _ = a && b || a;
12    |                  ^
13
14 error: this boolean expression can be simplified
15   --> $DIR/booleans.rs:14:13
16    |
17 14 |     let _ = !true;
18    |             ^^^^^ help: try: `false`
19    |
20    = note: `-D nonminimal-bool` implied by `-D warnings`
21
22 error: this boolean expression can be simplified
23   --> $DIR/booleans.rs:15:13
24    |
25 15 |     let _ = !false;
26    |             ^^^^^^ help: try: `true`
27
28 error: this boolean expression can be simplified
29   --> $DIR/booleans.rs:16:13
30    |
31 16 |     let _ = !!a;
32    |             ^^^ help: try: `a`
33
34 error: this boolean expression contains a logic bug
35   --> $DIR/booleans.rs:17:13
36    |
37 17 |     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:17:22
42    |
43 17 |     let _ = false && a;
44    |                      ^
45
46 error: this boolean expression can be simplified
47   --> $DIR/booleans.rs:18:13
48    |
49 18 |     let _ = false || a;
50    |             ^^^^^^^^^^ help: try: `a`
51
52 error: this boolean expression can be simplified
53   --> $DIR/booleans.rs:23:13
54    |
55 23 |     let _ = !(!a && b);
56    |             ^^^^^^^^^^ help: try: `!b || a`
57
58 error: this boolean expression contains a logic bug
59   --> $DIR/booleans.rs:33:13
60    |
61 33 |     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:33:13
66    |
67 33 |     let _ = a == b && a != b;
68    |             ^^^^^^
69
70 error: this boolean expression can be simplified
71   --> $DIR/booleans.rs:34:13
72    |
73 34 |     let _ = a == b && c == 5 && a == b;
74    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
75    |
76 help: try
77    |
78 34 |     let _ = a == b && c == 5;
79    |             ^^^^^^^^^^^^^^^^
80 34 |     let _ = !(c != 5 || a != b);
81    |             ^^^^^^^^^^^^^^^^^^^
82
83 error: this boolean expression can be simplified
84   --> $DIR/booleans.rs:35:13
85    |
86 35 |     let _ = a == b && c == 5 && b == a;
87    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
88    |
89 help: try
90    |
91 35 |     let _ = a == b && c == 5;
92    |             ^^^^^^^^^^^^^^^^
93 35 |     let _ = !(c != 5 || a != b);
94    |             ^^^^^^^^^^^^^^^^^^^
95
96 error: this boolean expression contains a logic bug
97   --> $DIR/booleans.rs:36:13
98    |
99 36 |     let _ = a < b && a >= b;
100    |             ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
101    |
102 help: this expression can be optimized out by applying boolean operations to the outer expression
103   --> $DIR/booleans.rs:36:13
104    |
105 36 |     let _ = a < b && a >= b;
106    |             ^^^^^
107
108 error: this boolean expression contains a logic bug
109   --> $DIR/booleans.rs:37:13
110    |
111 37 |     let _ = a > b && a <= b;
112    |             ^^^^^^^^^^^^^^^ help: it would look like the following: `false`
113    |
114 help: this expression can be optimized out by applying boolean operations to the outer expression
115   --> $DIR/booleans.rs:37:13
116    |
117 37 |     let _ = a > b && a <= b;
118    |             ^^^^^
119
120 error: this boolean expression can be simplified
121   --> $DIR/booleans.rs:39:13
122    |
123 39 |     let _ = a != b || !(a != b || c == d);
124    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125    |
126 help: try
127    |
128 39 |     let _ = c != d || a != b;
129    |             ^^^^^^^^^^^^^^^^
130 39 |     let _ = !(a == b && c == d);
131    |             ^^^^^^^^^^^^^^^^^^^
132