summaryrefslogtreecommitdiff
path: root/src/hir
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-06-29 13:22:41 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-06-29 13:22:41 +0800
commit9bc9346b6acb96838a6144c9bd96c4370e14b0ec (patch)
tree9876612028e2e0afc36b0ea0674067dc3fc9f478 /src/hir
parent155ab2b1e09a8a9a18c4c8201c85f61e7317ff34 (diff)
downloadmrust-9bc9346b6acb96838a6144c9bd96c4370e14b0ec.tar.gz
HIR Gen - Improved error message with integer overflow
Diffstat (limited to 'src/hir')
-rw-r--r--src/hir/from_ast.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp
index 3976aa9d..0ce55478 100644
--- a/src/hir/from_ast.cpp
+++ b/src/hir/from_ast.cpp
@@ -751,8 +751,9 @@ HIR::LifetimeRef LowerHIR_LifetimeRef(const ::AST::LifetimeRef& r)
{
if( ptr->m_datatype == CORETYPE_UINT || ptr->m_datatype == CORETYPE_ANY )
{
+ // TODO: Chage the HIR format to support very large arrays
if( ptr->m_value > UINT_MAX ) {
- ERROR(ty.span(), E0000, "Array size out of bounds - " << ptr->m_value << " > " << UINT_MAX);
+ ERROR(ty.span(), E0000, "Array size out of bounds - 0x" << ::std::hex << ptr->m_value << " > 0x" << UINT_MAX);
}
auto size_val = static_cast<unsigned int>( ptr->m_value );
return ::HIR::TypeRef::new_array( mv$(inner), size_val );