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