summaryrefslogtreecommitdiff
path: root/src/mir/cleanup.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-12-11 22:32:12 +0800
committerJohn Hodge <tpg@mutabah.net>2016-12-11 22:32:12 +0800
commitf54b532f00e183dc0250435acdff3beec5d7ae51 (patch)
treef7f13ae7ce5d9c8969d2923afdc57296671e5763 /src/mir/cleanup.cpp
parent577fe1d0c3d891ec1b3fd60db2a6675917c98be0 (diff)
downloadmrust-f54b532f00e183dc0250435acdff3beec5d7ae51.tar.gz
HIR Const Eval - Split into two passes to have correct types in literals
Diffstat (limited to 'src/mir/cleanup.cpp')
-rw-r--r--src/mir/cleanup.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mir/cleanup.cpp b/src/mir/cleanup.cpp
index c5a8c5b9..4268b288 100644
--- a/src/mir/cleanup.cpp
+++ b/src/mir/cleanup.cpp
@@ -74,6 +74,8 @@ const ::HIR::Literal* MIR_Cleanup_GetConstant(const Span& sp, const StaticTraitR
if( pe.m_params.m_types.size() != 0 )
TODO(sp, "Generic constants - " << path);
out_ty = constant.m_type.clone();
+ if( constant.m_value_res.is_Invalid() )
+ return nullptr;
return &constant.m_value_res;
),
(UfcsUnknown,