From f116baeed7072d7126c4cf844dbd02fc4e49080f Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 11 Sep 2018 08:31:35 +0300 Subject: [PATCH] Add a test for match flattening --- tests/source/match-flattening.rs | 21 +++++++++++++++++++++ tests/target/match-flattening.rs | 23 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/source/match-flattening.rs create mode 100644 tests/target/match-flattening.rs diff --git a/tests/source/match-flattening.rs b/tests/source/match-flattening.rs new file mode 100644 index 000000000000..935ece53b83b --- /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 000000000000..f246952a08d4 --- /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 + } + } + } +}