about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/bool_comparison.stderr
blob: 98881a2d20fd3d2fc211502d220776181bd1aab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
error: equality checks against true are unnecessary
  --> tests/ui/bool_comparison.rs:7:16
   |
LL |     let _ = if x == true { "yes" } else { "no" };
   |                ^^^^^^^^^ help: try: `x`
   |
   = note: `-D clippy::bool-comparison` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::bool_comparison)]`

error: equality checks against false can be replaced by a negation
  --> tests/ui/bool_comparison.rs:9:16
   |
LL |     let _ = if x == false { "yes" } else { "no" };
   |                ^^^^^^^^^^ help: try: `!x`

error: equality checks against true are unnecessary
  --> tests/ui/bool_comparison.rs:11:16
   |
LL |     let _ = if true == x { "yes" } else { "no" };
   |                ^^^^^^^^^ help: try: `x`

error: equality checks against false can be replaced by a negation
  --> tests/ui/bool_comparison.rs:13:16
   |
LL |     let _ = if false == x { "yes" } else { "no" };
   |                ^^^^^^^^^^ help: try: `!x`

error: inequality checks against true can be replaced by a negation
  --> tests/ui/bool_comparison.rs:15:16
   |
LL |     let _ = if x != true { "yes" } else { "no" };
   |                ^^^^^^^^^ help: try: `!x`

error: inequality checks against false are unnecessary
  --> tests/ui/bool_comparison.rs:17:16
   |
LL |     let _ = if x != false { "yes" } else { "no" };
   |                ^^^^^^^^^^ help: try: `x`

error: inequality checks against true can be replaced by a negation
  --> tests/ui/bool_comparison.rs:19:16
   |
LL |     let _ = if true != x { "yes" } else { "no" };
   |                ^^^^^^^^^ help: try: `!x`

error: inequality checks against false are unnecessary
  --> tests/ui/bool_comparison.rs:21:16
   |
LL |     let _ = if false != x { "yes" } else { "no" };
   |                ^^^^^^^^^^ help: try: `x`

error: less than comparison against true can be replaced by a negation
  --> tests/ui/bool_comparison.rs:23:16
   |
LL |     let _ = if x < true { "yes" } else { "no" };
   |                ^^^^^^^^ help: try: `!x`

error: greater than checks against false are unnecessary
  --> tests/ui/bool_comparison.rs:25:16
   |
LL |     let _ = if false < x { "yes" } else { "no" };
   |                ^^^^^^^^^ help: try: `x`

error: greater than checks against false are unnecessary
  --> tests/ui/bool_comparison.rs:27:16
   |
LL |     let _ = if x > false { "yes" } else { "no" };
   |                ^^^^^^^^^ help: try: `x`

error: less than comparison against true can be replaced by a negation
  --> tests/ui/bool_comparison.rs:29:16
   |
LL |     let _ = if true > x { "yes" } else { "no" };
   |                ^^^^^^^^ help: try: `!x`

error: order comparisons between booleans can be simplified
  --> tests/ui/bool_comparison.rs:33:16
   |
LL |     let _ = if x < y { "yes" } else { "no" };
   |                ^^^^^ help: try: `!x & y`

error: order comparisons between booleans can be simplified
  --> tests/ui/bool_comparison.rs:35:16
   |
LL |     let _ = if x > y { "yes" } else { "no" };
   |                ^^^^^ help: try: `x & !y`

error: equality checks against false can be replaced by a negation
  --> tests/ui/bool_comparison.rs:92:8
   |
LL |     if false == m!(func) {}
   |        ^^^^^^^^^^^^^^^^^ help: try: `!m!(func)`

error: equality checks against false can be replaced by a negation
  --> tests/ui/bool_comparison.rs:94:8
   |
LL |     if m!(func) == false {}
   |        ^^^^^^^^^^^^^^^^^ help: try: `!m!(func)`

error: equality checks against true are unnecessary
  --> tests/ui/bool_comparison.rs:96:8
   |
LL |     if true == m!(func) {}
   |        ^^^^^^^^^^^^^^^^ help: try: `m!(func)`

error: equality checks against true are unnecessary
  --> tests/ui/bool_comparison.rs:98:8
   |
LL |     if m!(func) == true {}
   |        ^^^^^^^^^^^^^^^^ help: try: `m!(func)`

error: equality checks against false can be replaced by a negation
  --> tests/ui/bool_comparison.rs:116:14
   |
LL |     let _ = ((1 < 2) == false) as usize;
   |              ^^^^^^^^^^^^^^^^ help: try: `1 >= 2`

error: equality checks against false can be replaced by a negation
  --> tests/ui/bool_comparison.rs:118:14
   |
LL |     let _ = (false == m!(func)) as usize;
   |              ^^^^^^^^^^^^^^^^^ help: try: `!m!(func)`

error: order comparisons between booleans can be simplified
  --> tests/ui/bool_comparison.rs:122:14
   |
LL |     let _ = ((1 < 2) > m!(func)) as usize;
   |              ^^^^^^^^^^^^^^^^^^ help: try: `(1 < 2) & !m!(func)`

error: order comparisons between booleans can be simplified
  --> tests/ui/bool_comparison.rs:144:9
   |
LL |         x > m!(func)
   |         ^^^^^^^^^^^^ help: try: `x & !m!(func)`

error: order comparisons between booleans can be simplified
  --> tests/ui/bool_comparison.rs:149:9
   |
LL |         x < m!(func)
   |         ^^^^^^^^^^^^ help: try: `!x & m!(func)`

error: aborting due to 23 previous errors