summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/match_bool.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/match_bool.stderr')
-rw-r--r--src/tools/clippy/tests/ui/match_bool.stderr117
1 files changed, 117 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/match_bool.stderr b/src/tools/clippy/tests/ui/match_bool.stderr
new file mode 100644
index 000000000..3fd0468e5
--- /dev/null
+++ b/src/tools/clippy/tests/ui/match_bool.stderr
@@ -0,0 +1,117 @@
+error: this boolean expression can be simplified
+ --> $DIR/match_bool.rs:31:11
+ |
+LL | match test && test {
+ | ^^^^^^^^^^^^ help: try: `test`
+ |
+ = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
+
+error: you seem to be trying to match on a boolean expression
+ --> $DIR/match_bool.rs:6:5
+ |
+LL | / match test {
+LL | | true => 0,
+LL | | false => 42,
+LL | | };
+ | |_____^ help: consider using an `if`/`else` expression: `if test { 0 } else { 42 }`
+ |
+note: the lint level is defined here
+ --> $DIR/match_bool.rs:1:9
+ |
+LL | #![deny(clippy::match_bool)]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: you seem to be trying to match on a boolean expression
+ --> $DIR/match_bool.rs:12:5
+ |
+LL | / match option == 1 {
+LL | | true => 1,
+LL | | false => 0,
+LL | | };
+ | |_____^ 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
+ --> $DIR/match_bool.rs:17:5
+ |
+LL | / match test {
+LL | | true => (),
+LL | | false => {
+LL | | println!("Noooo!");
+LL | | },
+LL | | };
+ | |_____^
+ |
+help: consider using an `if`/`else` expression
+ |
+LL ~ if !test {
+LL + println!("Noooo!");
+LL ~ };
+ |
+
+error: you seem to be trying to match on a boolean expression
+ --> $DIR/match_bool.rs:24:5
+ |
+LL | / match test {
+LL | | false => {
+LL | | println!("Noooo!");
+LL | | },
+LL | | _ => (),
+LL | | };
+ | |_____^
+ |
+help: consider using an `if`/`else` expression
+ |
+LL ~ if !test {
+LL + println!("Noooo!");
+LL ~ };
+ |
+
+error: you seem to be trying to match on a boolean expression
+ --> $DIR/match_bool.rs:31:5
+ |
+LL | / match test && test {
+LL | | false => {
+LL | | println!("Noooo!");
+LL | | },
+LL | | _ => (),
+LL | | };
+ | |_____^
+ |
+help: consider using an `if`/`else` expression
+ |
+LL ~ if !(test && test) {
+LL + println!("Noooo!");
+LL ~ };
+ |
+
+error: equal expressions as operands to `&&`
+ --> $DIR/match_bool.rs:31:11
+ |
+LL | match test && test {
+ | ^^^^^^^^^^^^
+ |
+ = note: `#[deny(clippy::eq_op)]` on by default
+
+error: you seem to be trying to match on a boolean expression
+ --> $DIR/match_bool.rs:38:5
+ |
+LL | / match test {
+LL | | false => {
+LL | | println!("Noooo!");
+LL | | },
+... |
+LL | | },
+LL | | };
+ | |_____^
+ |
+help: consider using an `if`/`else` expression
+ |
+LL ~ if test {
+LL + println!("Yes!");
+LL + } else {
+LL + println!("Noooo!");
+LL ~ };
+ |
+
+error: aborting due to 8 previous errors
+