Skip to content

Commit c0f6909

Browse files
committed
base::iter_structural_ty: structs and records
1 parent 68b3f0d commit c0f6909

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
@@ -676,9 +676,10 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
676676
let mut cx = cx;
677677
match /*bad*/copy ty::get(t).sty {
678678
ty::ty_rec(*) | ty::ty_struct(*) => {
679-
do expr::with_field_tys(cx.tcx(), t, None) |_has_dtor, field_tys| {
679+
let repr = adt::represent_type(cx.ccx(), t);
680+
do expr::with_field_tys(cx.tcx(), t, None) |discr, field_tys| {
680681
for vec::eachi(field_tys) |i, field_ty| {
681-
let llfld_a = GEPi(cx, av, struct_field(i));
682+
let llfld_a = adt::trans_GEP(cx, &repr, av, discr, i);
682683
cx = f(cx, llfld_a, field_ty.mt.ty);
683684
}
684685
}

0 commit comments

Comments
 (0)