Skip to content

Commit f0422b8

Browse files
committed
base::iter_structural_ty: tuples
1 parent 3b8c9de commit f0422b8

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
@@ -700,10 +700,11 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
700700
cx = tvec::iter_vec_raw(cx, base, t, len, f);
701701
}
702702
ty::ty_tup(args) => {
703-
for vec::eachi(args) |i, arg| {
704-
let llfld_a = GEPi(cx, av, [0u, i]);
705-
cx = f(cx, llfld_a, *arg);
706-
}
703+
let repr = adt::represent_type(cx.ccx(), t);
704+
for vec::eachi(args) |i, arg| {
705+
let llfld_a = adt::trans_GEP(cx, &repr, av, 0, i);
706+
cx = f(cx, llfld_a, *arg);
707+
}
707708
}
708709
ty::ty_enum(tid, ref substs) => {
709710
let variants = ty::enum_variants(cx.tcx(), tid);

0 commit comments

Comments
 (0)