]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_bool.stderr
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / needless_bool.stderr
1 error: this if-then-else expression will always return true
2  --> $DIR/needless_bool.rs:9:5
3   |
4 9 |     if x { true } else { true };
5   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7   = note: `-D clippy::needless-bool` implied by `-D warnings`
8
9 error: this if-then-else expression will always return false
10   --> $DIR/needless_bool.rs:10:5
11    |
12 10 |     if x { false } else { false };
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: this if-then-else expression returns a bool literal
16   --> $DIR/needless_bool.rs:11:5
17    |
18 11 |     if x { true } else { false };
19    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `x`
20
21 error: this if-then-else expression returns a bool literal
22   --> $DIR/needless_bool.rs:12:5
23    |
24 12 |     if x { false } else { true };
25    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!x`
26
27 error: this if-then-else expression returns a bool literal
28   --> $DIR/needless_bool.rs:13:5
29    |
30 13 |     if x && y { false } else { true };
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!(x && y)`
32
33 error: this if-then-else expression will always return true
34   --> $DIR/needless_bool.rs:25:5
35    |
36 25 |     if x { return true } else { return true };
37    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39 error: this if-then-else expression will always return false
40   --> $DIR/needless_bool.rs:30:5
41    |
42 30 |     if x { return false } else { return false };
43    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45 error: this if-then-else expression returns a bool literal
46   --> $DIR/needless_bool.rs:35:5
47    |
48 35 |     if x { return true } else { return false };
49    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x`
50
51 error: this if-then-else expression returns a bool literal
52   --> $DIR/needless_bool.rs:40:5
53    |
54 40 |     if x && y { return true } else { return false };
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return x && y`
56
57 error: this if-then-else expression returns a bool literal
58   --> $DIR/needless_bool.rs:45:5
59    |
60 45 |     if x { return false } else { return true };
61    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !x`
62
63 error: this if-then-else expression returns a bool literal
64   --> $DIR/needless_bool.rs:50:5
65    |
66 50 |     if x && y { return false } else { return true };
67    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `return !(x && y)`
68
69 error: aborting due to 11 previous errors
70