Skip to content

Commit 429269e

Browse files
committed
---
yaml --- r: 45032 b: refs/heads/master c: 5ca4fdf h: refs/heads/master v: v3
1 parent d3c226c commit 429269e

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 29d0430c56276da7371a845008bef3d1361b842e
2+
refs/heads/master: 5ca4fdfc981a9c0c7ecf3e23c4b26c05a6a7d2fe
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/librustc/middle/trans/base.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,8 +1938,23 @@ pub fn trans_tuple_struct(ccx: @CrateContext,
19381938
let arg_tys = ty::ty_fn_args(node_id_type(bcx, ctor_id));
19391939
let bcx = copy_args_to_allocas(fcx, bcx, fn_args, raw_llargs, arg_tys);
19401940
1941+
// XXX is there a better way to reconstruct the ty::t?
1942+
let ty_param_substs = match param_substs {
1943+
Some(ref substs) => /*bad*/copy substs.tys,
1944+
None => ~[]
1945+
};
1946+
let ctor_ty = ty::subst_tps(ccx.tcx, ty_param_substs, None,
1947+
ty::node_id_to_type(ccx.tcx, ctor_id));
1948+
let tup_ty = match ty::get(ctor_ty).sty {
1949+
ty::ty_bare_fn(ref bft) => bft.sig.output,
1950+
_ => ccx.sess.bug(fmt!("trans_tuple_struct: unexpected ctor \
1951+
return type %s",
1952+
ty_to_str(ccx.tcx, ctor_ty)))
1953+
};
1954+
let repr = adt::represent_type(ccx, tup_ty);
1955+
19411956
for fields.eachi |i, field| {
1942-
let lldestptr = GEPi(bcx, fcx.llretptr, [0, 0, i]);
1957+
let lldestptr = adt::trans_GEP(bcx, &repr, fcx.llretptr, 0, i);
19431958
let llarg = match fcx.llargs.get(&field.node.id) {
19441959
local_mem(x) => x,
19451960
_ => {

0 commit comments

Comments
 (0)