Skip to content

Commit 4a5bc70

Browse files
committed
---
yaml --- r: 1516 b: refs/heads/master c: 94b681a h: refs/heads/master v: v3
1 parent d4b760d commit 4a5bc70

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
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: 1dc6bdf33191cbd183bb17331e4a71d5c80ad353
2+
refs/heads/master: 94b681afe4f8fb09141d459963b268c76fbd0072

trunk/src/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,7 @@ TEST_XFAILS_BOOT := $(TASK_XFAILS) \
432432
test/compile-fail/tail-non-call.rs \
433433
test/compile-fail/writing-through-read-alias.rs
434434

435-
TEST_XFAILS_RUSTC := $(CONST_TAG_XFAILS) \
436-
$(addprefix test/run-pass/, \
435+
TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
437436
acyclic-unwind.rs \
438437
alt-pattern-drop.rs \
439438
alt-type-simple.rs \

trunk/src/comp/middle/trans.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,17 +363,22 @@ fn T_taskptr(type_names tn) -> TypeRef {
363363
ret T_ptr(T_task(tn));
364364
}
365365

366-
fn T_typaram_ptr(type_names tn) -> TypeRef {
366+
// This type must never be used directly; it must always be cast away.
367+
fn T_typaram(type_names tn) -> TypeRef {
367368
auto s = "typaram";
368369
if (tn.name_has_type(s)) {
369370
ret tn.get_type(s);
370371
}
371372

372-
auto t = T_ptr(T_i8());
373+
auto t = T_i8();
373374
tn.associate(s, t);
374375
ret t;
375376
}
376377

378+
fn T_typaram_ptr(type_names tn) -> TypeRef {
379+
ret T_ptr(T_typaram(tn));
380+
}
381+
377382
fn T_closure_ptr(type_names tn,
378383
TypeRef lltarget_ty,
379384
TypeRef llbindings_ty,
@@ -2068,7 +2073,6 @@ fn call_tydesc_glue(@block_ctxt cx, ValueRef v, @ty.t t, int field) {
20682073
fn incr_all_refcnts(@block_ctxt cx,
20692074
ValueRef v,
20702075
@ty.t t) -> result {
2071-
20722076
if (!ty.type_is_scalar(t)) {
20732077
call_tydesc_glue(cx, v, t, abi.tydesc_field_take_glue_off);
20742078
}
@@ -4820,9 +4824,18 @@ fn trans_tag_variant(@crate_ctxt cx, ast.def_id tag_id,
48204824
// works. So we have to cast to the destination's view of the type.
48214825
auto llargptr = bcx.build.PointerCast(fcx.llargs.get(va.id),
48224826
val_ty(lldestptr));
4823-
auto llargval = bcx.build.Load(llargptr);
48244827

4825-
bcx.build.Store(llargval, lldestptr);
4828+
auto arg_ty = arg_tys.(i).ty;
4829+
auto llargval;
4830+
if (ty.type_is_structural(arg_ty)) {
4831+
llargval = llargptr;
4832+
} else {
4833+
llargval = bcx.build.Load(llargptr);
4834+
}
4835+
4836+
rslt = copy_ty(bcx, INIT, lldestptr, llargval, arg_ty);
4837+
bcx = rslt.bcx;
4838+
48264839
i += 1u;
48274840
}
48284841

0 commit comments

Comments
 (0)