Skip to content

Commit 936f96a

Browse files
committed
base::iter_structural_ty: structs and records
1 parent f0422b8 commit 936f96a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,10 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
687687
let mut cx = cx;
688688
match /*bad*/copy ty::get(t).sty {
689689
ty::ty_rec(*) | ty::ty_struct(*) => {
690-
do expr::with_field_tys(cx.tcx(), t, None) |_has_dtor, field_tys| {
690+
let repr = adt::represent_type(cx.ccx(), t);
691+
do expr::with_field_tys(cx.tcx(), t, None) |discr, field_tys| {
691692
for vec::eachi(field_tys) |i, field_ty| {
692-
let llfld_a = GEPi(cx, av, struct_field(i));
693+
let llfld_a = adt::trans_GEP(cx, &repr, av, discr, i);
693694
cx = f(cx, llfld_a, field_ty.mt.ty);
694695
}
695696
}

0 commit comments

Comments
 (0)