summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-03-10 22:47:25 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-03-10 22:47:25 +0800
commit993fc7a94a3aa2d8f59b59b0f0e30a282c5fa433 (patch)
treeeaa0d306bb8f915cab5ee185c9f68c917873e000
parent13e2409860c35c8693675d7c2c9b202741f7ddde (diff)
downloadmrust-993fc7a94a3aa2d8f59b59b0f0e30a282c5fa433.tar.gz
MIR Helpers - get_const_type defer TODO
-rw-r--r--src/mir/helpers.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mir/helpers.cpp b/src/mir/helpers.cpp
index 9c2107ab..9dac1567 100644
--- a/src/mir/helpers.cpp
+++ b/src/mir/helpers.cpp
@@ -252,14 +252,17 @@ const ::HIR::TypeRef& ::MIR::TypeResolve::get_lvalue_type(::HIR::TypeRef& tmp, c
auto v = m_resolve.get_value(this->sp, e.p, p, /*signature_only=*/true);
if( const auto* ve = v.opt_Constant() ) {
const auto& ty = (*ve)->m_type;
- MIR_TODO(*this, "Monomorphise type " << ty);
+ if( monomorphise_type_needed(ty) )
+ MIR_TODO(*this, "get_const_type - Monomorphise type " << ty);
+ else
+ return ty.clone();
}
else {
- MIR_BUG(*this, "");
+ MIR_BUG(*this, "get_const_type - Not a constant");
}
),
(ItemAddr,
- MIR_TODO(*this, "Get type for constant `" << c << "`");
+ MIR_TODO(*this, "get_const_type - Get type for constant `" << c << "`");
)
)
throw "";