Skip to content

Commit 7d0bdcc

Browse files
committed
---
yaml --- r: 46815 b: refs/heads/auto c: 5ca4fdf h: refs/heads/master i: 46813: d61de11 46811: 3fe772f 46807: 153bb3e 46799: 354c8dd 46783: cc9f7ca v: v3
1 parent e91e964 commit 7d0bdcc

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
@@ -14,4 +14,4 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 29d0430c56276da7371a845008bef3d1361b842e
17+
refs/heads/auto: 5ca4fdfc981a9c0c7ecf3e23c4b26c05a6a7d2fe

branches/auto/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)