Skip to content

Commit 42b03d7

Browse files
committed
---
yaml --- r: 1542 b: refs/heads/master c: 6ed226c h: refs/heads/master v: v3
1 parent 532fd87 commit 42b03d7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6f7e21ddac7bd956db55ea6885fbcfd3fb9f29a7
2+
refs/heads/master: 6ed226c6b3a28f3c10d2176d7dba7e339bf0ab99

trunk/src/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
472472
lib-uint.rs \
473473
lib-vec-str-conversions.rs \
474474
lib-vec.rs \
475-
list.rs \
476475
many.rs \
477476
mlist-cycle.rs \
478477
mlist.rs \

trunk/src/comp/middle/trans.rs

+9
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,15 @@ fn trans_unary(@block_ctxt cx, ast.unop op,
22662266
vec(C_int(0),
22672267
C_int(abi.box_rc_field_body)));
22682268
sub.bcx.build.Store(C_int(1), rc);
2269+
2270+
// Cast the body type to the type of the value. This is needed to
2271+
// make tags work, since tags have a different LLVM type depending
2272+
// on whether they're boxed or not.
2273+
if (!ty.type_has_dynamic_size(e_ty)) {
2274+
auto llety = T_ptr(type_of(sub.bcx.fcx.ccx, e_ty));
2275+
body = sub.bcx.build.PointerCast(body, llety);
2276+
}
2277+
22692278
sub = copy_ty(sub.bcx, INIT, body, e_val, e_ty);
22702279
ret res(sub.bcx, box);
22712280
}

0 commit comments

Comments
 (0)