Skip to content

Commit af5274c

Browse files
committed
---
yaml --- r: 5771 b: refs/heads/master c: 306f7fb h: refs/heads/master i: 5769: b251b03 5767: 1963939 v: v3
1 parent 0b01f0a commit af5274c

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 75bda422df0c7816d4b987a564d11935a0cdb8db
2+
refs/heads/master: 306f7fb25f6c4eec0a0a517edb2b2821468efdf3

trunk/src/comp/middle/trans.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,22 +2092,12 @@ fn copy_val_no_check(bcx: @block_ctxt, action: copy_action, dst: ValueRef,
20922092
ret bcx;
20932093
}
20942094
if ty::type_is_nil(ccx.tcx, t) || ty::type_is_bot(ccx.tcx, t) { ret bcx; }
2095-
if ty::type_is_boxed(ccx.tcx, t) {
2095+
if ty::type_is_boxed(ccx.tcx, t) || ty::type_is_vec(ccx.tcx, t) ||
2096+
ty::type_is_unique_box(ccx.tcx, t) {
20962097
if action == DROP_EXISTING { bcx = drop_ty(bcx, dst, t); }
20972098
Store(bcx, src, dst);
20982099
ret take_ty(bcx, dst, t);
20992100
}
2100-
if ty::type_is_vec(ccx.tcx, t) {
2101-
if action == DROP_EXISTING { bcx = drop_ty(bcx, dst, t); }
2102-
let {bcx, val} = tvec::duplicate(bcx, src, t);
2103-
Store(bcx, val, dst);
2104-
ret bcx;
2105-
}
2106-
if ty::type_is_unique_box(ccx.tcx, t) {
2107-
if action == DROP_EXISTING { bcx = drop_ty(bcx, dst, t); }
2108-
check trans_uniq::type_is_unique_box(bcx, t);
2109-
ret trans_uniq::copy_val(bcx, dst, src, t);
2110-
}
21112101
if type_is_structural_or_param(ccx.tcx, t) {
21122102
if action == DROP_EXISTING { bcx = drop_ty(bcx, dst, t); }
21132103
bcx = memmove_ty(bcx, dst, src, t);

trunk/src/comp/middle/trans_uniq.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import trans::{
1515
dest
1616
};
1717

18-
export trans_uniq, make_free_glue, type_is_unique_box, copy_val,
19-
autoderef, duplicate;
18+
export trans_uniq, make_free_glue, type_is_unique_box, autoderef, duplicate;
2019

2120
pure fn type_is_unique_box(bcx: @block_ctxt, ty: ty::t) -> bool {
2221
ty::type_is_unique_box(bcx_tcx(bcx), ty)
@@ -77,19 +76,6 @@ fn content_ty(bcx: @block_ctxt, t: ty::t)
7776
}
7877
}
7978

80-
fn copy_val(cx: @block_ctxt, dst: ValueRef, src: ValueRef,
81-
ty: ty::t) : type_is_unique_box(cx, ty) -> @block_ctxt {
82-
83-
let content_ty = content_ty(cx, ty);
84-
let {bcx, val: llptr} = alloc_uniq(cx, ty);
85-
Store(bcx, llptr, dst);
86-
87-
let src = load_if_immediate(bcx, src, content_ty);
88-
let dst = llptr;
89-
let bcx = trans::copy_val(bcx, INIT, dst, src, content_ty);
90-
ret bcx;
91-
}
92-
9379
fn autoderef(bcx: @block_ctxt, v: ValueRef, t: ty::t)
9480
: type_is_unique_box(bcx, t) -> {v: ValueRef, t: ty::t} {
9581

0 commit comments

Comments
 (0)