about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2018-09-11 08:31:35 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2018-09-11 08:54:43 +0300
commitf116baeed7072d7126c4cf844dbd02fc4e49080f (patch)
treed50b8422adb530ba20ffa1feaaa4ca85679c4c40
parentbc03234e25740ecc8ff6a35f5ae2f6d89fc0c232 (diff)
Add a test for match flattening
-rw-r--r--tests/source/match-flattening.rs21
-rw-r--r--tests/target/match-flattening.rs23
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/source/match-flattening.rs b/tests/source/match-flattening.rs
new file mode 100644
index 00000000000..935ece53b83
--- /dev/null
+++ b/tests/source/match-flattening.rs
@@ -0,0 +1,21 @@
+fn main() {
+    match option {
+        None => if condition {
+            true
+        } else {
+            false
+        },
+    }
+}
+
+fn main() {
+    match option {
+        None => {
+            if condition {
+                true
+            } else {
+                false
+            }
+        }
+    }
+}
diff --git a/tests/target/match-flattening.rs b/tests/target/match-flattening.rs
new file mode 100644
index 00000000000..f246952a08d
--- /dev/null
+++ b/tests/target/match-flattening.rs
@@ -0,0 +1,23 @@
+fn main() {
+    match option {
+        None => {
+            if condition {
+                true
+            } else {
+                false
+            }
+        }
+    }
+}
+
+fn main() {
+    match option {
+        None => {
+            if condition {
+                true
+            } else {
+                false
+            }
+        }
+    }
+}