1 error: this if-then-else expression will always return true
2 --> needless_bool.rs:9:5
4 9 | if x { true } else { true };
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `-D needless-bool` implied by `-D warnings`
9 error: this if-then-else expression will always return false
10 --> needless_bool.rs:10:5
12 10 | if x { false } else { false };
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 = note: `-D needless-bool` implied by `-D warnings`
17 error: this if-then-else expression returns a bool literal
18 --> needless_bool.rs:11:5
20 11 | if x { true } else { false };
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `x`
23 = note: `-D needless-bool` implied by `-D warnings`
25 error: this if-then-else expression returns a bool literal
26 --> needless_bool.rs:12:5
28 12 | if x { false } else { true };
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!x`
31 = note: `-D needless-bool` implied by `-D warnings`
33 error: this if-then-else expression returns a bool literal
34 --> needless_bool.rs:13:5
36 13 | if x && y { false } else { true };
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `!(x && y)`
39 = note: `-D needless-bool` implied by `-D warnings`
41 error: this if-then-else expression will always return true
42 --> needless_bool.rs:25:5
44 25 | if x { return true } else { return true };
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 = note: `-D needless-bool` implied by `-D warnings`
49 error: this if-then-else expression will always return false
50 --> needless_bool.rs:30:5
52 30 | if x { return false } else { return false };
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55 = note: `-D needless-bool` implied by `-D warnings`
57 error: this if-then-else expression returns a bool literal
58 --> needless_bool.rs:35:5
60 35 | if x { return true } else { return false };
61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x`
63 = note: `-D needless-bool` implied by `-D warnings`
65 error: this if-then-else expression returns a bool literal
66 --> needless_bool.rs:40:5
68 40 | if x && y { return true } else { return false };
69 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return x && y`
71 = note: `-D needless-bool` implied by `-D warnings`
73 error: this if-then-else expression returns a bool literal
74 --> needless_bool.rs:45:5
76 45 | if x { return false } else { return true };
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !x`
79 = note: `-D needless-bool` implied by `-D warnings`
81 error: this if-then-else expression returns a bool literal
82 --> needless_bool.rs:50:5
84 50 | if x && y { return false } else { return true };
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to `return !(x && y)`
87 = note: `-D needless-bool` implied by `-D warnings`
89 error: aborting due to previous error(s)
91 error: Could not compile `clippy_tests`.
93 To learn more, run the command again with --verbose.