From 68b3f0d8a419c94eaead13517cd87aaf5fc74b86 Mon Sep 17 00:00:00 2001 From: Jed Davis Date: Sun, 24 Feb 2013 17:32:09 -0800 Subject: [PATCH] base::iter_structural_ty: tuples --- src/librustc/middle/trans/base.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 26d2e02cb96..ca934d755b4 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -689,10 +689,11 @@ fn iter_variant(cx: block, a_tup: ValueRef, cx = tvec::iter_vec_raw(cx, base, t, len, f); } ty::ty_tup(args) => { - for vec::eachi(args) |i, arg| { - let llfld_a = GEPi(cx, av, [0u, i]); - cx = f(cx, llfld_a, *arg); - } + let repr = adt::represent_type(cx.ccx(), t); + for vec::eachi(args) |i, arg| { + let llfld_a = adt::trans_GEP(cx, &repr, av, 0, i); + cx = f(cx, llfld_a, *arg); + } } ty::ty_enum(tid, ref substs) => { let variants = ty::enum_variants(cx.tcx(), tid);