summaryrefslogtreecommitdiff
path: root/src/mir/from_hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r--src/mir/from_hir.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp
index a281cbaa..c6d9bcd3 100644
--- a/src/mir/from_hir.cpp
+++ b/src/mir/from_hir.cpp
@@ -378,7 +378,10 @@ namespace {
if( node.m_arms.size() == 0 ) {
// Nothing
- TODO(node.span(), "Handle zero-arm match - can only match over ! or similar");
+ //const auto& ty = node.m_value->m_res_type;
+ // TODO: Ensure that the type is a zero-variant enum or !
+ m_builder.end_split_arm_early(node.span());
+ m_builder.end_block( ::MIR::Terminator::make_Diverge({}) );
}
else if( node.m_arms.size() == 1 && node.m_arms[0].m_patterns.size() == 1 && ! node.m_arms[0].m_cond ) {
// - Shortcut: Single-arm match