]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_bool.stderr
Merge branch 'master' into rustfmt_tests
[rust.git] / tests / ui / needless_bool.stderr
1 error: this if-then-else expression will always return true
2   --> $DIR/needless_bool.rs:40:5
3    |
4 40 | /     if x {
5 41 | |         true
6 42 | |     } else {
7 43 | |         true
8 44 | |     };
9    | |_____^
10    |
11    = note: `-D clippy::needless-bool` implied by `-D warnings`
12
13 error: this if-then-else expression will always return false
14   --> $DIR/needless_bool.rs:45:5
15    |
16 45 | /     if x {
17 46 | |         false
18 47 | |     } else {
19 48 | |         false
20 49 | |     };
21    | |_____^
22
23 error: this if-then-else expression returns a bool literal
24   --> $DIR/needless_bool.rs:50:5
25    |
26 50 | /     if x {
27 51 | |         true
28 52 | |     } else {
29 53 | |         false
30 54 | |     };
31    | |_____^ help: you can reduce it to: `x`
32
33 error: this if-then-else expression returns a bool literal
34   --> $DIR/needless_bool.rs:55:5
35    |
36 55 | /     if x {
37 56 | |         false
38 57 | |     } else {
39 58 | |         true
40 59 | |     };
41    | |_____^ help: you can reduce it to: `!x`
42
43 error: this if-then-else expression returns a bool literal
44   --> $DIR/needless_bool.rs:60:5
45    |
46 60 | /     if x && y {
47 61 | |         false
48 62 | |     } else {
49 63 | |         true
50 64 | |     };
51    | |_____^ help: you can reduce it to: `!(x && y)`
52
53 error: this if-then-else expression will always return true
54   --> $DIR/needless_bool.rs:83:5
55    |
56 83 | /     if x {
57 84 | |         return true;
58 85 | |     } else {
59 86 | |         return true;
60 87 | |     };
61    | |_____^
62
63 error: this if-then-else expression will always return false
64   --> $DIR/needless_bool.rs:92:5
65    |
66 92 | /     if x {
67 93 | |         return false;
68 94 | |     } else {
69 95 | |         return false;
70 96 | |     };
71    | |_____^
72
73 error: this if-then-else expression returns a bool literal
74    --> $DIR/needless_bool.rs:101:5
75     |
76 101 | /     if x {
77 102 | |         return true;
78 103 | |     } else {
79 104 | |         return false;
80 105 | |     };
81     | |_____^ help: you can reduce it to: `return x`
82
83 error: this if-then-else expression returns a bool literal
84    --> $DIR/needless_bool.rs:110:5
85     |
86 110 | /     if x && y {
87 111 | |         return true;
88 112 | |     } else {
89 113 | |         return false;
90 114 | |     };
91     | |_____^ help: you can reduce it to: `return x && y`
92
93 error: this if-then-else expression returns a bool literal
94    --> $DIR/needless_bool.rs:119:5
95     |
96 119 | /     if x {
97 120 | |         return false;
98 121 | |     } else {
99 122 | |         return true;
100 123 | |     };
101     | |_____^ help: you can reduce it to: `return !x`
102
103 error: this if-then-else expression returns a bool literal
104    --> $DIR/needless_bool.rs:128:5
105     |
106 128 | /     if x && y {
107 129 | |         return false;
108 130 | |     } else {
109 131 | |         return true;
110 132 | |     };
111     | |_____^ help: you can reduce it to: `return !(x && y)`
112
113 error: equality checks against true are unnecessary
114    --> $DIR/needless_bool.rs:136:8
115     |
116 136 |     if x == true {};
117     |        ^^^^^^^^^ help: try simplifying it as shown: `x`
118     |
119     = note: `-D clippy::bool-comparison` implied by `-D warnings`
120
121 error: equality checks against false can be replaced by a negation
122    --> $DIR/needless_bool.rs:140:8
123     |
124 140 |     if x == false {};
125     |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
126
127 error: equality checks against true are unnecessary
128    --> $DIR/needless_bool.rs:150:8
129     |
130 150 |     if x == true {};
131     |        ^^^^^^^^^ help: try simplifying it as shown: `x`
132
133 error: equality checks against false can be replaced by a negation
134    --> $DIR/needless_bool.rs:151:8
135     |
136 151 |     if x == false {};
137     |        ^^^^^^^^^^ help: try simplifying it as shown: `!x`
138
139 error: aborting due to 15 previous errors
140