summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-11-22 18:54:19 +0800
committerJohn Hodge <tpg@mutabah.net>2016-11-22 18:54:19 +0800
commitd0582a003d0017ffad55798b8d9dd42e260c0005 (patch)
tree3055bafa13588ced802e90c97e79327e6e65dd60
parent4a70e38c072519785e70844fbf00310c14904f3d (diff)
downloadmrust-d0582a003d0017ffad55798b8d9dd42e260c0005.tar.gz
MIR Gen - (minor) Better error message for invalid result type from literal
-rw-r--r--src/mir/from_hir.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp
index 7761ab12..bd853e87 100644
--- a/src/mir/from_hir.cpp
+++ b/src/mir/from_hir.cpp
@@ -1462,6 +1462,7 @@ namespace {
TRACE_FUNCTION_F("_Literal");
TU_MATCHA( (node.m_data), (e),
(Integer,
+ ASSERT_BUG(node.span(), node.m_res_type.m_data.is_Primitive(), "Non-primitive return type for Integer literal - " << node.m_res_type);
switch(node.m_res_type.m_data.as_Primitive())
{
case ::HIR::CoreType::U8: