summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-06 20:24:11 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-06 20:24:11 +0800
commitc697fde0aa120968d8439b79b1a75f84d0ce6777 (patch)
tree0aa62b7120265503d7bbe61bc6e5d5951d98ee2d
parenta841e501db4da2ddae3b2cd6f65a85aadd1e714b (diff)
downloadmrust-c697fde0aa120968d8439b79b1a75f84d0ce6777.tar.gz
MIR Gen Match - Allow single-value ranges
-rw-r--r--src/mir/from_hir_match.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mir/from_hir_match.cpp b/src/mir/from_hir_match.cpp
index 29eb391f..620fd368 100644
--- a/src/mir/from_hir_match.cpp
+++ b/src/mir/from_hir_match.cpp
@@ -2290,8 +2290,7 @@ namespace
const char* name, const field_path_t& field_path, ::std::function<void(DecisionTreeNode::Branch&)> and_then
)
{
- ASSERT_BUG(sp, ve_start != ve_end, "Range pattern with one value - " << ve_start);
- ASSERT_BUG(sp, ve_start < ve_end, "Range pattern with a start after the end - " << ve_start << "..." << ve_end);
+ ASSERT_BUG(sp, ve_start <= ve_end, "Range pattern with a start after the end - " << ve_start << "..." << ve_end);
TRACE_FUNCTION_F("[" << FMT_CB(os, for(const auto& i:be) os << i.first <<" , ";) << "]");
// - Find the first entry that ends after the new one starts.