@@ -31,7 +31,67 @@ LL | | };
3131 | |_____^ help: you can reduce it to: `!(x && y)`
3232
3333error: this if-then-else expression returns a bool literal
34- --> $DIR/fixable.rs:72:5
34+ --> $DIR/fixable.rs:59:5
35+ |
36+ LL | / if a == b {
37+ LL | | false
38+ LL | | } else {
39+ LL | | true
40+ LL | | };
41+ | |_____^ help: you can reduce it to: `a != b`
42+
43+ error: this if-then-else expression returns a bool literal
44+ --> $DIR/fixable.rs:64:5
45+ |
46+ LL | / if a != b {
47+ LL | | false
48+ LL | | } else {
49+ LL | | true
50+ LL | | };
51+ | |_____^ help: you can reduce it to: `a == b`
52+
53+ error: this if-then-else expression returns a bool literal
54+ --> $DIR/fixable.rs:69:5
55+ |
56+ LL | / if a < b {
57+ LL | | false
58+ LL | | } else {
59+ LL | | true
60+ LL | | };
61+ | |_____^ help: you can reduce it to: `a >= b`
62+
63+ error: this if-then-else expression returns a bool literal
64+ --> $DIR/fixable.rs:74:5
65+ |
66+ LL | / if a <= b {
67+ LL | | false
68+ LL | | } else {
69+ LL | | true
70+ LL | | };
71+ | |_____^ help: you can reduce it to: `a > b`
72+
73+ error: this if-then-else expression returns a bool literal
74+ --> $DIR/fixable.rs:79:5
75+ |
76+ LL | / if a > b {
77+ LL | | false
78+ LL | | } else {
79+ LL | | true
80+ LL | | };
81+ | |_____^ help: you can reduce it to: `a <= b`
82+
83+ error: this if-then-else expression returns a bool literal
84+ --> $DIR/fixable.rs:84:5
85+ |
86+ LL | / if a >= b {
87+ LL | | false
88+ LL | | } else {
89+ LL | | true
90+ LL | | };
91+ | |_____^ help: you can reduce it to: `a < b`
92+
93+ error: this if-then-else expression returns a bool literal
94+ --> $DIR/fixable.rs:105:5
3595 |
3696LL | / if x {
3797LL | | return true;
@@ -41,7 +101,7 @@ LL | | };
41101 | |_____^ help: you can reduce it to: `return x`
42102
43103error: this if-then-else expression returns a bool literal
44- --> $DIR/fixable.rs:80 :5
104+ --> $DIR/fixable.rs:113 :5
45105 |
46106LL | / if x {
47107LL | | return false;
@@ -51,7 +111,7 @@ LL | | };
51111 | |_____^ help: you can reduce it to: `return !x`
52112
53113error: this if-then-else expression returns a bool literal
54- --> $DIR/fixable.rs:88 :5
114+ --> $DIR/fixable.rs:121 :5
55115 |
56116LL | / if x && y {
57117LL | | return true;
@@ -61,7 +121,7 @@ LL | | };
61121 | |_____^ help: you can reduce it to: `return x && y`
62122
63123error: this if-then-else expression returns a bool literal
64- --> $DIR/fixable.rs:96 :5
124+ --> $DIR/fixable.rs:129 :5
65125 |
66126LL | / if x && y {
67127LL | | return false;
@@ -71,33 +131,33 @@ LL | | };
71131 | |_____^ help: you can reduce it to: `return !(x && y)`
72132
73133error: equality checks against true are unnecessary
74- --> $DIR/fixable.rs:104 :8
134+ --> $DIR/fixable.rs:137 :8
75135 |
76136LL | if x == true {};
77137 | ^^^^^^^^^ help: try simplifying it as shown: `x`
78138 |
79139 = note: `-D clippy::bool-comparison` implied by `-D warnings`
80140
81141error: equality checks against false can be replaced by a negation
82- --> $DIR/fixable.rs:108 :8
142+ --> $DIR/fixable.rs:141 :8
83143 |
84144LL | if x == false {};
85145 | ^^^^^^^^^^ help: try simplifying it as shown: `!x`
86146
87147error: equality checks against true are unnecessary
88- --> $DIR/fixable.rs:118 :8
148+ --> $DIR/fixable.rs:151 :8
89149 |
90150LL | if x == true {};
91151 | ^^^^^^^^^ help: try simplifying it as shown: `x`
92152
93153error: equality checks against false can be replaced by a negation
94- --> $DIR/fixable.rs:119 :8
154+ --> $DIR/fixable.rs:152 :8
95155 |
96156LL | if x == false {};
97157 | ^^^^^^^^^^ help: try simplifying it as shown: `!x`
98158
99159error: this if-then-else expression returns a bool literal
100- --> $DIR/fixable.rs:128 :12
160+ --> $DIR/fixable.rs:161 :12
101161 |
102162LL | } else if returns_bool() {
103163 | ____________^
@@ -108,7 +168,7 @@ LL | | };
108168 | |_____^ help: you can reduce it to: `{ !returns_bool() }`
109169
110170error: this if-then-else expression returns a bool literal
111- --> $DIR/fixable.rs:141 :5
171+ --> $DIR/fixable.rs:174 :5
112172 |
113173LL | / if unsafe { no(4) } & 1 != 0 {
114174LL | | true
@@ -118,16 +178,16 @@ LL | | };
118178 | |_____^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
119179
120180error: this if-then-else expression returns a bool literal
121- --> $DIR/fixable.rs:146 :30
181+ --> $DIR/fixable.rs:179 :30
122182 |
123183LL | let _brackets_unneeded = if unsafe { no(4) } & 1 != 0 { true } else { false };
124184 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `unsafe { no(4) } & 1 != 0`
125185
126186error: this if-then-else expression returns a bool literal
127- --> $DIR/fixable.rs:149 :9
187+ --> $DIR/fixable.rs:182 :9
128188 |
129189LL | if unsafe { no(4) } & 1 != 0 { true } else { false }
130190 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `(unsafe { no(4) } & 1 != 0)`
131191
132- error: aborting due to 15 previous errors
192+ error: aborting due to 21 previous errors
133193
0 commit comments