Skip to content

Commit 777a536

Browse files
committed
Support non-immediates in unique-box type glue
Issue #409
1 parent 856acbf commit 777a536

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/comp/middle/trans_uniq.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import trans::{
1212
INIT,
1313
trans_shared_free,
1414
drop_ty,
15-
new_sub_block_ctxt
15+
new_sub_block_ctxt,
16+
load_if_immediate
1617
};
1718

1819
export trans_uniq, make_free_glue, type_is_unique_box, copy_val,
@@ -115,7 +116,8 @@ fn duplicate(bcx: @block_ctxt, v: ValueRef, t: ty::t)
115116
let content_ty = content_ty(bcx, t);
116117
let {bcx, val: llptr} = alloc_uniq(bcx, t);
117118

118-
let src = Load(bcx, Load(bcx, v));
119+
let src = Load(bcx, v);
120+
let src = load_if_immediate(bcx, src, content_ty);
119121
let dst = llptr;
120122
let bcx = trans::copy_val(bcx, INIT, dst, src, content_ty);
121123
Store(bcx, dst, v);

src/test/run-pass/expr-alt-generic-unique1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-test
21

32

43
// -*- rust -*-

src/test/run-pass/expr-block-generic-unique1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-test
21

32

43
// -*- rust -*-

0 commit comments

Comments
 (0)