about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-06-30 00:49:57 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-06-30 16:22:58 -0400
commit45e2582e09dd97d01a01e351c47da210bd6803f3 (patch)
treef0ef468bd2108b809d0a1df941084570d60baed7
parent7f3752c7f95a2439db774d977da0caa299ef48e6 (diff)
downloadrust-45e2582e09dd97d01a01e351c47da210bd6803f3.tar.gz
rust-45e2582e09dd97d01a01e351c47da210bd6803f3.zip
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
-rw-r--r--src/librustc/middle/trans/closure.rs3
-rw-r--r--src/librustc/middle/trans/uniq.rs10
2 files changed, 4 insertions, 9 deletions
diff --git a/src/librustc/middle/trans/closure.rs b/src/librustc/middle/trans/closure.rs
index ad68ffb402e..d99b9b109ef 100644
--- a/src/librustc/middle/trans/closure.rs
+++ b/src/librustc/middle/trans/closure.rs
@@ -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,
diff --git a/src/librustc/middle/trans/uniq.rs b/src/librustc/middle/trans/uniq.rs
index d27d6efb241..ada85c82b30 100644
--- a/src/librustc/middle/trans/uniq.rs
+++ b/src/librustc/middle/trans/uniq.rs
@@ -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)
 }