]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/match_bool.stderr
Auto merge of #71321 - matthewjasper:alloc-min-spec, r=sfackler
[rust.git] / src / tools / clippy / tests / ui / match_bool.stderr
1 error: this boolean expression can be simplified
2   --> $DIR/match_bool.rs:31:11
3    |
4 LL |     match test && test {
5    |           ^^^^^^^^^^^^ help: try: `test`
6    |
7    = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
8
9 error: you seem to be trying to match on a boolean expression
10   --> $DIR/match_bool.rs:6:5
11    |
12 LL | /     match test {
13 LL | |         true => 0,
14 LL | |         false => 42,
15 LL | |     };
16    | |_____^ help: consider using an `if`/`else` expression: `if test { 0 } else { 42 }`
17    |
18 note: the lint level is defined here
19   --> $DIR/match_bool.rs:1:9
20    |
21 LL | #![deny(clippy::match_bool)]
22    |         ^^^^^^^^^^^^^^^^^^
23
24 error: you seem to be trying to match on a boolean expression
25   --> $DIR/match_bool.rs:12:5
26    |
27 LL | /     match option == 1 {
28 LL | |         true => 1,
29 LL | |         false => 0,
30 LL | |     };
31    | |_____^ help: consider using an `if`/`else` expression: `if option == 1 { 1 } else { 0 }`
32
33 error: you seem to be trying to match on a boolean expression
34   --> $DIR/match_bool.rs:17:5
35    |
36 LL | /     match test {
37 LL | |         true => (),
38 LL | |         false => {
39 LL | |             println!("Noooo!");
40 LL | |         },
41 LL | |     };
42    | |_____^
43    |
44 help: consider using an `if`/`else` expression
45    |
46 LL |     if !test {
47 LL |         println!("Noooo!");
48 LL |     };
49    |
50
51 error: you seem to be trying to match on a boolean expression
52   --> $DIR/match_bool.rs:24:5
53    |
54 LL | /     match test {
55 LL | |         false => {
56 LL | |             println!("Noooo!");
57 LL | |         },
58 LL | |         _ => (),
59 LL | |     };
60    | |_____^
61    |
62 help: consider using an `if`/`else` expression
63    |
64 LL |     if !test {
65 LL |         println!("Noooo!");
66 LL |     };
67    |
68
69 error: you seem to be trying to match on a boolean expression
70   --> $DIR/match_bool.rs:31:5
71    |
72 LL | /     match test && test {
73 LL | |         false => {
74 LL | |             println!("Noooo!");
75 LL | |         },
76 LL | |         _ => (),
77 LL | |     };
78    | |_____^
79    |
80 help: consider using an `if`/`else` expression
81    |
82 LL |     if !(test && test) {
83 LL |         println!("Noooo!");
84 LL |     };
85    |
86
87 error: equal expressions as operands to `&&`
88   --> $DIR/match_bool.rs:31:11
89    |
90 LL |     match test && test {
91    |           ^^^^^^^^^^^^
92    |
93    = note: `#[deny(clippy::eq_op)]` on by default
94
95 error: you seem to be trying to match on a boolean expression
96   --> $DIR/match_bool.rs:38:5
97    |
98 LL | /     match test {
99 LL | |         false => {
100 LL | |             println!("Noooo!");
101 LL | |         },
102 ...  |
103 LL | |         },
104 LL | |     };
105    | |_____^
106    |
107 help: consider using an `if`/`else` expression
108    |
109 LL |     if test {
110 LL |         println!("Yes!");
111 LL |     } else {
112 LL |         println!("Noooo!");
113 LL |     };
114    |
115
116 error: aborting due to 8 previous errors
117