Skip to content

Commit 68b3f0d

Browse files
committed
base::iter_structural_ty: tuples
1 parent ca450e3 commit 68b3f0d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,11 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
689689
cx = tvec::iter_vec_raw(cx, base, t, len, f);
690690
}
691691
ty::ty_tup(args) => {
692-
for vec::eachi(args) |i, arg| {
693-
let llfld_a = GEPi(cx, av, [0u, i]);
694-
cx = f(cx, llfld_a, *arg);
695-
}
692+
let repr = adt::represent_type(cx.ccx(), t);
693+
for vec::eachi(args) |i, arg| {
694+
let llfld_a = adt::trans_GEP(cx, &repr, av, 0, i);
695+
cx = f(cx, llfld_a, *arg);
696+
}
696697
}
697698
ty::ty_enum(tid, ref substs) => {
698699
let variants = ty::enum_variants(cx.tcx(), tid);

0 commit comments

Comments
 (0)