rust/tests/ui/match_bool.stderr

75 lines
2.3 KiB
Plaintext
Raw Normal View History

2018-04-07 10:23:27 +02:00
error: this boolean expression can be simplified
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:35:11
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
35 | match test && test {
2018-04-07 10:23:27 +02:00
| ^^^^^^^^^^^^ help: try: `test`
|
= note: `-D clippy::nonminimal-bool` implied by `-D warnings`
2018-04-07 10:23:27 +02:00
error: you seem to be trying to match on a boolean expression
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:14:5
|
14 | / match test {
15 | | true => 0,
16 | | false => 42,
17 | | };
| |_____^ help: consider using an if/else expression: `if test { 0 } else { 42 }`
|
= note: `-D clippy::match-bool` implied by `-D warnings`
2018-04-07 10:23:27 +02:00
error: you seem to be trying to match on a boolean expression
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:20:5
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
20 | / match option == 1 {
21 | | true => 1,
22 | | false => 0,
23 | | };
2018-04-07 10:23:27 +02:00
| |_____^ help: consider using an if/else expression: `if option == 1 { 1 } else { 0 }`
error: you seem to be trying to match on a boolean expression
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:25:5
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
25 | / match test {
26 | | true => (),
27 | | false => { println!("Noooo!"); }
28 | | };
2018-04-07 10:23:27 +02:00
| |_____^ help: consider using an if/else expression: `if !test { println!("Noooo!"); }`
error: you seem to be trying to match on a boolean expression
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:30:5
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
30 | / match test {
31 | | false => { println!("Noooo!"); }
32 | | _ => (),
33 | | };
2018-04-07 10:23:27 +02:00
| |_____^ help: consider using an if/else expression: `if !test { println!("Noooo!"); }`
error: you seem to be trying to match on a boolean expression
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:35:5
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
35 | / match test && test {
36 | | false => { println!("Noooo!"); }
37 | | _ => (),
38 | | };
2018-04-07 10:23:27 +02:00
| |_____^ help: consider using an if/else expression: `if !(test && test) { println!("Noooo!"); }`
error: equal expressions as operands to `&&`
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:35:11
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
35 | match test && test {
2018-04-07 10:23:27 +02:00
| ^^^^^^^^^^^^
|
= note: #[deny(clippy::eq_op)] on by default
2018-04-07 10:23:27 +02:00
error: you seem to be trying to match on a boolean expression
2018-10-06 18:18:06 +02:00
--> $DIR/match_bool.rs:40:5
2018-04-07 10:23:27 +02:00
|
2018-10-06 18:18:06 +02:00
40 | / match test {
41 | | false => { println!("Noooo!"); }
42 | | true => { println!("Yes!"); }
43 | | };
2018-04-07 10:23:27 +02:00
| |_____^ help: consider using an if/else expression: `if test { println!("Yes!"); } else { println!("Noooo!"); }`
error: aborting due to 8 previous errors