diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-18 21:40:06 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-18 21:40:06 +0800 |
commit | c0d8141930e95f71a6d4fb84114fdc8a449527b7 (patch) | |
tree | 828892e2cbee599bc15227ba3270f6ddc82d2581 /src/mir/from_hir_match.cpp | |
parent | 65aba167033019994e35f43b819d8fbd3620e9ff (diff) | |
download | mrust-c0d8141930e95f71a6d4fb84114fdc8a449527b7.tar.gz |
All - Support tuple patterns with .. at the start/end - TODO: Support in the middle
Diffstat (limited to 'src/mir/from_hir_match.cpp')
-rw-r--r-- | src/mir/from_hir_match.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp index 3ea61cf9..a2d786d8 100644 --- a/src/mir/from_hir_match.cpp +++ b/src/mir/from_hir_match.cpp @@ -949,6 +949,7 @@ void PatternRulesetBuilder::append_from(const Span& sp, const ::HIR::Pattern& pa } ), (Tuple, + ASSERT_BUG(sp, pe.glob_pos == ::HIR::Pattern::GlobPos::None, "Tuple .. should be eliminated"); assert(e.size() == pe.sub_patterns.size()); for(unsigned int i = 0; i < e.size(); i ++) { this->append_from(sp, pe.sub_patterns[i], e[i]); @@ -996,9 +997,6 @@ void PatternRulesetBuilder::append_from(const Span& sp, const ::HIR::Pattern& pa ), (StructTuple, TODO(sp, "Match over struct - Tuple + StructTuple"); - ), - (StructTupleWildcard, - TODO(sp, "Match over struct - Tuple + StructTupleWildcard"); ) ) ), @@ -1053,9 +1051,6 @@ void PatternRulesetBuilder::append_from(const Span& sp, const ::HIR::Pattern& pa } this->push_rule( PatternRule::make_Variant({ pe.binding_idx, mv$(sub_builder.m_rules) }) ); ), - (EnumTupleWildcard, - this->push_rule( PatternRule::make_Variant({ pe.binding_idx, {} }) ); - ), (EnumStruct, const auto& var_def = pe.binding_ptr->m_variants.at(pe.binding_idx); const auto& fields_def = var_def.second.as_Struct(); |