summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/needless_bool/fixable.stderr
blob: 25abfb2a472b621130483c7eb5629ef7f946fab1 (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
error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:39:5
   |
LL | /     if x {
LL | |         true
LL | |     } else {
LL | |         false
LL | |     };
   | |_____^ help: you can reduce it to: `x`
   |
   = note: `-D clippy::needless-bool` implied by `-D warnings`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:44:5
   |
LL | /     if x {
LL | |         false
LL | |     } else {
LL | |         true
LL | |     };
   | |_____^ help: you can reduce it to: `!x`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:49:5
   |
LL | /     if x && y {
LL | |         false
LL | |     } else {
LL | |         true
LL | |     };
   | |_____^ help: you can reduce it to: `!(x && y)`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:69:5
   |
LL | /     if x {
LL | |         return true;
LL | |     } else {
LL | |         return false;
LL | |     };
   | |_____^ help: you can reduce it to: `return x`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:77:5
   |
LL | /     if x {
LL | |         return false;
LL | |     } else {
LL | |         return true;
LL | |     };
   | |_____^ help: you can reduce it to: `return !x`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:85:5
   |
LL | /     if x && y {
LL | |         return true;
LL | |     } else {
LL | |         return false;
LL | |     };
   | |_____^ help: you can reduce it to: `return x && y`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:93:5
   |
LL | /     if x && y {
LL | |         return false;
LL | |     } else {
LL | |         return true;
LL | |     };
   | |_____^ help: you can reduce it to: `return !(x && y)`

error: equality checks against true are unnecessary
  --> $DIR/fixable.rs:101:8
   |
LL |     if x == true {};
   |        ^^^^^^^^^ help: try simplifying it as shown: `x`
   |
   = note: `-D clippy::bool-comparison` implied by `-D warnings`

error: equality checks against false can be replaced by a negation
  --> $DIR/fixable.rs:105:8
   |
LL |     if x == false {};
   |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`

error: equality checks against true are unnecessary
  --> $DIR/fixable.rs:115:8
   |
LL |     if x == true {};
   |        ^^^^^^^^^ help: try simplifying it as shown: `x`

error: equality checks against false can be replaced by a negation
  --> $DIR/fixable.rs:116:8
   |
LL |     if x == false {};
   |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`

error: this if-then-else expression returns a bool literal
  --> $DIR/fixable.rs:125:12
   |
LL |       } else if returns_bool() {
   |  ____________^
LL | |         false
LL | |     } else {
LL | |         true
LL | |     };
   | |_____^ help: you can reduce it to: `{ !returns_bool() }`

error: aborting due to 12 previous errors