From dc035bbbee80e51d75acf4e726e3b30d94b49b36 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Thu, 2 Nov 2017 20:28:38 +0900 Subject: [PATCH] Add a test to see if tuple struct gets combined --- tests/source/pattern.rs | 15 +++++++++++++++ tests/target/pattern.rs | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/source/pattern.rs b/tests/source/pattern.rs index b8781bd1d2e..7c052c87bc4 100644 --- a/tests/source/pattern.rs +++ b/tests/source/pattern.rs @@ -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, + }; +} diff --git a/tests/target/pattern.rs b/tests/target/pattern.rs index 15fbef048c8..0287e423fa9 100644 --- a/tests/target/pattern.rs +++ b/tests/target/pattern.rs @@ -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, + }; +}