fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.3 KiB137 linesraw
1error: equality checks against true are unnecessary
2  --> $DIR/bool_comparison.rs:7:8
3   |
4LL |     if x == true {
5   |        ^^^^^^^^^ help: try simplifying it as shown: `x`
6   |
7   = note: `-D clippy::bool-comparison` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::bool_comparison)]`
9
10error: equality checks against false can be replaced by a negation
11  --> $DIR/bool_comparison.rs:12:8
12   |
13LL |     if x == false {
14   |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
15
16error: equality checks against true are unnecessary
17  --> $DIR/bool_comparison.rs:17:8
18   |
19LL |     if true == x {
20   |        ^^^^^^^^^ help: try simplifying it as shown: `x`
21
22error: equality checks against false can be replaced by a negation
23  --> $DIR/bool_comparison.rs:22:8
24   |
25LL |     if false == x {
26   |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
27
28error: inequality checks against true can be replaced by a negation
29  --> $DIR/bool_comparison.rs:27:8
30   |
31LL |     if x != true {
32   |        ^^^^^^^^^ help: try simplifying it as shown: `!x`
33
34error: inequality checks against false are unnecessary
35  --> $DIR/bool_comparison.rs:32:8
36   |
37LL |     if x != false {
38   |        ^^^^^^^^^^ help: try simplifying it as shown: `x`
39
40error: inequality checks against true can be replaced by a negation
41  --> $DIR/bool_comparison.rs:37:8
42   |
43LL |     if true != x {
44   |        ^^^^^^^^^ help: try simplifying it as shown: `!x`
45
46error: inequality checks against false are unnecessary
47  --> $DIR/bool_comparison.rs:42:8
48   |
49LL |     if false != x {
50   |        ^^^^^^^^^^ help: try simplifying it as shown: `x`
51
52error: less than comparison against true can be replaced by a negation
53  --> $DIR/bool_comparison.rs:47:8
54   |
55LL |     if x < true {
56   |        ^^^^^^^^ help: try simplifying it as shown: `!x`
57
58error: greater than checks against false are unnecessary
59  --> $DIR/bool_comparison.rs:52:8
60   |
61LL |     if false < x {
62   |        ^^^^^^^^^ help: try simplifying it as shown: `x`
63
64error: greater than checks against false are unnecessary
65  --> $DIR/bool_comparison.rs:57:8
66   |
67LL |     if x > false {
68   |        ^^^^^^^^^ help: try simplifying it as shown: `x`
69
70error: less than comparison against true can be replaced by a negation
71  --> $DIR/bool_comparison.rs:62:8
72   |
73LL |     if true > x {
74   |        ^^^^^^^^ help: try simplifying it as shown: `!x`
75
76error: order comparisons between booleans can be simplified
77  --> $DIR/bool_comparison.rs:68:8
78   |
79LL |     if x < y {
80   |        ^^^^^ help: try simplifying it as shown: `!x & y`
81
82error: order comparisons between booleans can be simplified
83  --> $DIR/bool_comparison.rs:73:8
84   |
85LL |     if x > y {
86   |        ^^^^^ help: try simplifying it as shown: `x & !y`
87
88error: this comparison might be written more concisely
89  --> $DIR/bool_comparison.rs:121:8
90   |
91LL |     if a == !b {};
92   |        ^^^^^^^ help: try simplifying it as shown: `a != b`
93
94error: this comparison might be written more concisely
95  --> $DIR/bool_comparison.rs:122:8
96   |
97LL |     if !a == b {};
98   |        ^^^^^^^ help: try simplifying it as shown: `a != b`
99
100error: this comparison might be written more concisely
101  --> $DIR/bool_comparison.rs:126:8
102   |
103LL |     if b == !a {};
104   |        ^^^^^^^ help: try simplifying it as shown: `b != a`
105
106error: this comparison might be written more concisely
107  --> $DIR/bool_comparison.rs:127:8
108   |
109LL |     if !b == a {};
110   |        ^^^^^^^ help: try simplifying it as shown: `b != a`
111
112error: equality checks against false can be replaced by a negation
113  --> $DIR/bool_comparison.rs:151:8
114   |
115LL |     if false == m!(func) {}
116   |        ^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `!m!(func)`
117
118error: equality checks against false can be replaced by a negation
119  --> $DIR/bool_comparison.rs:152:8
120   |
121LL |     if m!(func) == false {}
122   |        ^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `!m!(func)`
123
124error: equality checks against true are unnecessary
125  --> $DIR/bool_comparison.rs:153:8
126   |
127LL |     if true == m!(func) {}
128   |        ^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `m!(func)`
129
130error: equality checks against true are unnecessary
131  --> $DIR/bool_comparison.rs:154:8
132   |
133LL |     if m!(func) == true {}
134   |        ^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `m!(func)`
135
136error: aborting due to 22 previous errors
137