stop copying the tydesc in unique box take glue

the only user of the tydesc is ~fn, and it doesn't use this glue code
This commit is contained in:
Daniel Micay 2013-06-30 00:49:57 -04:00
parent 7f3752c7f9
commit 45e2582e09
2 changed files with 4 additions and 9 deletions

View file

@ -486,6 +486,9 @@ pub fn make_closure_glue(
}
}
// note: unique pointers no longer copy the type descriptor in the take glue,
// so we cannot delegate to the unique box take glue here without copying it
// ourselves
pub fn make_opaque_cbox_take_glue(
bcx: block,
sigil: ast::Sigil,

View file

@ -52,13 +52,5 @@ pub fn duplicate(bcx: block, src_box: ValueRef, src_ty: ty::t) -> Result {
} = malloc_unique(bcx, body_datum.ty);
body_datum.copy_to(bcx, datum::INIT, dst_body);
// Copy the type descriptor
let src_tydesc_ptr = GEPi(bcx, src_box,
[0u, back::abi::box_field_tydesc]);
let dst_tydesc_ptr = GEPi(bcx, dst_box,
[0u, back::abi::box_field_tydesc]);
let td = Load(bcx, src_tydesc_ptr);
Store(bcx, td, dst_tydesc_ptr);
return rslt(bcx, dst_box);
rslt(bcx, dst_box)
}