]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/needless_bool/fixable.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / needless_bool / fixable.stderr
CommitLineData
f20569fa
XL
1error: this if-then-else expression returns a bool literal
2 --> $DIR/fixable.rs:39:5
3 |
4LL | / if x {
5LL | | true
6LL | | } else {
7LL | | false
8LL | | };
9 | |_____^ help: you can reduce it to: `x`
10 |
11 = note: `-D clippy::needless-bool` implied by `-D warnings`
12
13error: this if-then-else expression returns a bool literal
14 --> $DIR/fixable.rs:44:5
15 |
16LL | / if x {
17LL | | false
18LL | | } else {
19LL | | true
20LL | | };
21 | |_____^ help: you can reduce it to: `!x`
22
23error: this if-then-else expression returns a bool literal
24 --> $DIR/fixable.rs:49:5
25 |
26LL | / if x && y {
27LL | | false
28LL | | } else {
29LL | | true
30LL | | };
31 | |_____^ help: you can reduce it to: `!(x && y)`
32
33error: this if-then-else expression returns a bool literal
34 --> $DIR/fixable.rs:69:5
35 |
36LL | / if x {
37LL | | return true;
38LL | | } else {
39LL | | return false;
40LL | | };
41 | |_____^ help: you can reduce it to: `return x`
42
43error: this if-then-else expression returns a bool literal
44 --> $DIR/fixable.rs:77:5
45 |
46LL | / if x {
47LL | | return false;
48LL | | } else {
49LL | | return true;
50LL | | };
51 | |_____^ help: you can reduce it to: `return !x`
52
53error: this if-then-else expression returns a bool literal
54 --> $DIR/fixable.rs:85:5
55 |
56LL | / if x && y {
57LL | | return true;
58LL | | } else {
59LL | | return false;
60LL | | };
61 | |_____^ help: you can reduce it to: `return x && y`
62
63error: this if-then-else expression returns a bool literal
64 --> $DIR/fixable.rs:93:5
65 |
66LL | / if x && y {
67LL | | return false;
68LL | | } else {
69LL | | return true;
70LL | | };
71 | |_____^ help: you can reduce it to: `return !(x && y)`
72
73error: equality checks against true are unnecessary
74 --> $DIR/fixable.rs:101:8
75 |
76LL | if x == true {};
77 | ^^^^^^^^^ help: try simplifying it as shown: `x`
78 |
79 = note: `-D clippy::bool-comparison` implied by `-D warnings`
80
81error: equality checks against false can be replaced by a negation
82 --> $DIR/fixable.rs:105:8
83 |
84LL | if x == false {};
85 | ^^^^^^^^^^ help: try simplifying it as shown: `!x`
86
87error: equality checks against true are unnecessary
88 --> $DIR/fixable.rs:115:8
89 |
90LL | if x == true {};
91 | ^^^^^^^^^ help: try simplifying it as shown: `x`
92
93error: equality checks against false can be replaced by a negation
94 --> $DIR/fixable.rs:116:8
95 |
96LL | if x == false {};
97 | ^^^^^^^^^^ help: try simplifying it as shown: `!x`
98
99error: this if-then-else expression returns a bool literal
100 --> $DIR/fixable.rs:125:12
101 |
102LL | } else if returns_bool() {
103 | ____________^
104LL | | false
105LL | | } else {
106LL | | true
107LL | | };
108 | |_____^ help: you can reduce it to: `{ !returns_bool() }`
109
110error: aborting due to 12 previous errors
111