summaryrefslogtreecommitdiff
path: root/src/trans/codegen_c.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-02 12:13:59 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-02 12:13:59 +0800
commitafb5fb9252d461e9b236fae9052a4607337db8c2 (patch)
tree74c51c4cd3e4a3d99b3a3cf1fbbb1473829f7700 /src/trans/codegen_c.cpp
parentb5a559c4b80ceb697212c98badea2e0192710e0c (diff)
downloadmrust-afb5fb9252d461e9b236fae9052a4607337db8c2.tar.gz
Trans Enumerate - Enumerate resultant types from LValue::Deref
Diffstat (limited to 'src/trans/codegen_c.cpp')
-rw-r--r--src/trans/codegen_c.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
index ef64ebcd..ce041294 100644
--- a/src/trans/codegen_c.cpp
+++ b/src/trans/codegen_c.cpp
@@ -267,9 +267,11 @@ namespace {
}
else if( const auto* ity = m_resolve.is_type_owned_box(struct_ty) )
{
- ::HIR::TypeRef inner_ptr = ::HIR::TypeRef::new_pointer( ::HIR::BorrowType::Unique, ity->clone() );
- ::HIR::GenericPath box_free { m_crate.get_lang_item_path(sp, "box_free"), { ity->clone() } };
+ auto inner_ptr = ::HIR::TypeRef::new_pointer( ::HIR::BorrowType::Unique, ity->clone() );
+ auto inner_drop_glue_path = ::HIR::Path(ity->clone(), "#drop_glue");
+ auto box_free = ::HIR::GenericPath { m_crate.get_lang_item_path(sp, "box_free"), { ity->clone() } };
m_of << "tUNIT " << Trans_Mangle(box_free) << "("; emit_ctype(inner_ptr, FMT_CB(ss, ss << "ptr"; )); m_of << ");\n";
+ m_of << "void " << Trans_Mangle(inner_drop_glue_path) << "("; emit_ctype(inner_ptr, FMT_CB(ss, ss << "ptr"; )); m_of << ");\n";
args.push_back( ::std::make_pair( ::HIR::Pattern {}, mv$(inner_ptr) ) );
}