summaryrefslogtreecommitdiff
path: root/src/mir/from_hir.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-19 10:27:38 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-19 10:27:38 +0800
commita3e8257c4f77f197c9be2dbae7aaddb81257abb2 (patch)
tree598c815b4e42041966e3a0834a118b9a7c56411f /src/mir/from_hir.cpp
parent64c957b03ede8b0af825b50e6e551c61444a3275 (diff)
downloadmrust-a3e8257c4f77f197c9be2dbae7aaddb81257abb2.tar.gz
Patterns - Support tuples with .. (fully)
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r--src/mir/from_hir.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp
index 55ce6cb1..800398b7 100644
--- a/src/mir/from_hir.cpp
+++ b/src/mir/from_hir.cpp
@@ -81,12 +81,14 @@ namespace {
destructure_from_ex(sp, *e.sub, ::MIR::LValue::make_Deref({ box$( mv$(lval) ) }), allow_refutable);
),
(Tuple,
- ASSERT_BUG(sp, e.glob_pos == ::HIR::Pattern::GlobPos::None, "Tuple .. should be eliminated");
for(unsigned int i = 0; i < e.sub_patterns.size(); i ++ )
{
destructure_from_ex(sp, e.sub_patterns[i], ::MIR::LValue::make_Field({ box$( lval.clone() ), i}), allow_refutable);
}
),
+ (SplitTuple,
+ BUG(sp, "Tuple .. should be eliminated");
+ ),
(StructValue,
// Nothing.
),