rust/tests/ui/match_bool.stderr

118 lines
2.7 KiB
Text
Raw Normal View History

2018-04-07 10:23:27 +02:00
error: this boolean expression can be simplified
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:31:11
2018-04-07 10:23:27 +02:00
|
2018-12-27 16:57:55 +01:00
LL | 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
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:6:5
2018-10-06 18:18:06 +02:00
|
2018-12-27 16:57:55 +01:00
LL | / match test {
LL | | true => 0,
LL | | false => 42,
LL | | };
2020-01-06 07:36:33 +01:00
| |_____^ help: consider using an `if`/`else` expression: `if test { 0 } else { 42 }`
2018-10-06 18:18:06 +02:00
|
2020-04-03 02:36:49 +02:00
note: the lint level is defined here
--> $DIR/match_bool.rs:1:9
|
LL | #![deny(clippy::match_bool)]
| ^^^^^^^^^^^^^^^^^^
2018-04-07 10:23:27 +02:00
error: you seem to be trying to match on a boolean expression
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:12:5
2018-04-07 10:23:27 +02:00
|
2018-12-27 16:57:55 +01:00
LL | / match option == 1 {
LL | | true => 1,
LL | | false => 0,
LL | | };
2020-01-06 07:36:33 +01:00
| |_____^ help: consider using an `if`/`else` expression: `if option == 1 { 1 } else { 0 }`
2018-04-07 10:23:27 +02:00
error: you seem to be trying to match on a boolean expression
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:17:5
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | / match test {
LL | | true => (),
LL | | false => {
LL | | println!("Noooo!");
LL | | },
LL | | };
2018-12-10 06:27:19 +01:00
| |_____^
2019-10-26 21:53:42 +02:00
|
2020-01-06 07:36:33 +01:00
help: consider using an `if`/`else` expression
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | if !test {
2020-02-04 16:13:06 +01:00
LL | println!("Noooo!");
LL | };
2018-04-07 10:23:27 +02:00
|
error: you seem to be trying to match on a boolean expression
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:24:5
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | / match test {
LL | | false => {
LL | | println!("Noooo!");
LL | | },
LL | | _ => (),
LL | | };
2018-12-10 06:27:19 +01:00
| |_____^
2019-10-26 21:53:42 +02:00
|
2020-01-06 07:36:33 +01:00
help: consider using an `if`/`else` expression
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | if !test {
2020-02-04 16:13:06 +01:00
LL | println!("Noooo!");
LL | };
2018-04-07 10:23:27 +02:00
|
error: you seem to be trying to match on a boolean expression
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:31:5
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | / match test && test {
LL | | false => {
LL | | println!("Noooo!");
LL | | },
LL | | _ => (),
LL | | };
2018-12-10 06:27:19 +01:00
| |_____^
2019-10-26 21:53:42 +02:00
|
2020-01-06 07:36:33 +01:00
help: consider using an `if`/`else` expression
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | if !(test && test) {
2020-02-04 16:13:06 +01:00
LL | println!("Noooo!");
LL | };
2018-04-07 10:23:27 +02:00
|
error: equal expressions as operands to `&&`
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:31:11
2018-04-07 10:23:27 +02:00
|
2018-12-27 16:57:55 +01:00
LL | 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
2020-04-03 02:36:49 +02:00
--> $DIR/match_bool.rs:38:5
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | / match test {
LL | | false => {
LL | | println!("Noooo!");
LL | | },
2018-12-10 06:27:19 +01:00
... |
2018-12-27 16:57:55 +01:00
LL | | },
LL | | };
2018-12-10 06:27:19 +01:00
| |_____^
2019-10-26 21:53:42 +02:00
|
2020-01-06 07:36:33 +01:00
help: consider using an `if`/`else` expression
2018-12-10 06:27:19 +01:00
|
2018-12-27 16:57:55 +01:00
LL | if test {
2020-02-04 16:13:06 +01:00
LL | println!("Yes!");
LL | } else {
LL | println!("Noooo!");
LL | };
2018-04-07 10:23:27 +02:00
|
error: aborting due to 8 previous errors