]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/needless_bool.stderr
e2cc011785ed8e1b09b9a1f967da757d0f320eaa
[rust.git] / clippy_tests / examples / needless_bool.stderr
1 error: this if-then-else expression will always return true
2  --> needless_bool.rs:9:5
3   |
4 9 |     if x { true } else { true };
5   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7   = note: `-D needless-bool` implied by `-D warnings`
8
9 error: this if-then-else expression will always return false
10   --> needless_bool.rs:10:5
11    |
12 10 |     if x { false } else { false };
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14    |
15    = note: `-D needless-bool` implied by `-D warnings`
16
17 error: this if-then-else expression returns a bool literal
18   --> needless_bool.rs:11:5
19    |
20 11 |     if x { true } else { false };
21    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `x`
22    |
23    = note: `-D needless-bool` implied by `-D warnings`
24
25 error: this if-then-else expression returns a bool literal
26   --> needless_bool.rs:12:5
27    |
28 12 |     if x { false } else { true };
29    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!x`
30    |
31    = note: `-D needless-bool` implied by `-D warnings`
32
33 error: this if-then-else expression returns a bool literal
34   --> needless_bool.rs:13:5
35    |
36 13 |     if x && y { false } else { true };
37    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!(x && y)`
38    |
39    = note: `-D needless-bool` implied by `-D warnings`
40
41 error: this if-then-else expression will always return true
42   --> needless_bool.rs:25:5
43    |
44 25 |     if x { return true } else { return true };
45    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46    |
47    = note: `-D needless-bool` implied by `-D warnings`
48
49 error: this if-then-else expression will always return false
50   --> needless_bool.rs:30:5
51    |
52 30 |     if x { return false } else { return false };
53    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54    |
55    = note: `-D needless-bool` implied by `-D warnings`
56
57 error: this if-then-else expression returns a bool literal
58   --> needless_bool.rs:35:5
59    |
60 35 |     if x { return true } else { return false };
61    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x`
62    |
63    = note: `-D needless-bool` implied by `-D warnings`
64
65 error: this if-then-else expression returns a bool literal
66   --> needless_bool.rs:40:5
67    |
68 40 |     if x && y { return true } else { return false };
69    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x && y`
70    |
71    = note: `-D needless-bool` implied by `-D warnings`
72
73 error: this if-then-else expression returns a bool literal
74   --> needless_bool.rs:45:5
75    |
76 45 |     if x { return false } else { return true };
77    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !x`
78    |
79    = note: `-D needless-bool` implied by `-D warnings`
80
81 error: this if-then-else expression returns a bool literal
82   --> needless_bool.rs:50:5
83    |
84 50 |     if x && y { return false } else { return true };
85    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !(x && y)`
86    |
87    = note: `-D needless-bool` implied by `-D warnings`
88
89 error: aborting due to previous error(s)
90
91 error: Could not compile `clippy_tests`.
92
93 To learn more, run the command again with --verbose.