]> git.lizzy.rs Git - rust.git/commitdiff
revert changes to trans_uniq.rs
authorNiko Matsakis <niko@alum.mit.edu>
Sat, 7 Jan 2012 03:40:49 +0000 (19:40 -0800)
committerNiko Matsakis <niko@alum.mit.edu>
Sat, 7 Jan 2012 06:40:32 +0000 (22:40 -0800)
src/comp/middle/trans_uniq.rs

index 5c4905207c85495711bd248aa93297afa7cb25b8..6b420a43091991006b23ee013fd5d66e8ac3b876 100644 (file)
@@ -33,14 +33,24 @@ fn trans_uniq(bcx: @block_ctxt, contents: @ast::expr,
     ret trans::store_in_dest(bcx, llptr, dest);
 }
 
-fn alloc_uniq(bcx: @block_ctxt, uniq_ty: ty::t)
-    : type_is_unique_box(bcx, uniq_ty) -> result {
+fn alloc_uniq(cx: @block_ctxt, uniq_ty: ty::t)
+    : type_is_unique_box(cx, uniq_ty) -> result {
+
+    let bcx = cx;
     let contents_ty = content_ty(bcx, uniq_ty);
-    let {bcx, val: llsz} = size_of(bcx, contents_ty);
+    let r = size_of(bcx, contents_ty);
+    bcx = r.bcx;
+    let llsz = r.val;
+
     let ccx = bcx_ccx(bcx);
     check non_ty_var(ccx, contents_ty);
     let llptrty = T_ptr(type_of_inner(ccx, bcx.sp, contents_ty));
-    ret trans_shared_malloc(bcx, llptrty, llsz);
+
+    r = trans_shared_malloc(bcx, llptrty, llsz);
+    bcx = r.bcx;
+    let llptr = r.val;
+
+    ret rslt(bcx, llptr);
 }
 
 fn make_free_glue(cx: @block_ctxt, vptr: ValueRef, t: ty::t)