]> git.lizzy.rs Git - rust.git/commitdiff
Add a test to see if tuple struct gets combined
authortopecongiro <seuchida@gmail.com>
Thu, 2 Nov 2017 11:28:38 +0000 (20:28 +0900)
committertopecongiro <seuchida@gmail.com>
Thu, 2 Nov 2017 11:28:38 +0000 (20:28 +0900)
tests/source/pattern.rs
tests/target/pattern.rs

index b8781bd1d2e1ea390534b46e17c7bbf8ed57c4e7..7c052c87bc457477445b6927b7047ef96badc37c 100644 (file)
@@ -48,3 +48,18 @@ fn issue_1874() {
 y
     }
 }
+
+fn combine_patterns() {
+    let x = match y {
+        Some(
+            Some(
+                Foo {
+                    z: Bar(..),
+                    a: Bar(..),
+                    b: Bar(..),
+                },
+            ),
+        ) => z,
+        _ => return,
+    };
+}
index 15fbef048c8b90557ba8d5918384cf413d3bce8e..0287e423fa96bfe66d8930f437e8d05237d3673a 100644 (file)
@@ -63,3 +63,14 @@ fn issue_1874() {
         y
     }
 }
+
+fn combine_patterns() {
+    let x = match y {
+        Some(Some(Foo {
+            z: Bar(..),
+            a: Bar(..),
+            b: Bar(..),
+        })) => z,
+        _ => return,
+    };
+}