Skip to content

Commit 0595f57

Browse files
committed
revert changes to trans_uniq.rs
1 parent 154f81b commit 0595f57

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/comp/middle/trans_uniq.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,24 @@ fn trans_uniq(bcx: @block_ctxt, contents: @ast::expr,
3333
ret trans::store_in_dest(bcx, llptr, dest);
3434
}
3535

36-
fn alloc_uniq(bcx: @block_ctxt, uniq_ty: ty::t)
37-
: type_is_unique_box(bcx, uniq_ty) -> result {
36+
fn alloc_uniq(cx: @block_ctxt, uniq_ty: ty::t)
37+
: type_is_unique_box(cx, uniq_ty) -> result {
38+
39+
let bcx = cx;
3840
let contents_ty = content_ty(bcx, uniq_ty);
39-
let {bcx, val: llsz} = size_of(bcx, contents_ty);
41+
let r = size_of(bcx, contents_ty);
42+
bcx = r.bcx;
43+
let llsz = r.val;
44+
4045
let ccx = bcx_ccx(bcx);
4146
check non_ty_var(ccx, contents_ty);
4247
let llptrty = T_ptr(type_of_inner(ccx, bcx.sp, contents_ty));
43-
ret trans_shared_malloc(bcx, llptrty, llsz);
48+
49+
r = trans_shared_malloc(bcx, llptrty, llsz);
50+
bcx = r.bcx;
51+
let llptr = r.val;
52+
53+
ret rslt(bcx, llptr);
4454
}
4555

4656
fn make_free_glue(cx: @block_ctxt, vptr: ValueRef, t: ty::t)

0 commit comments

Comments
 (0)