Skip to content

Commit 8733386

Browse files
committed
Make sure fold_ty preserves associated def_ids
Closes #1884
1 parent 0f00d9a commit 8733386

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/comp/middle/ty.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
607607
cx.sess.fatal("Unsupported sort of type in fold_ty");
608608
}
609609
}
610+
alt tb.o_def_id {
611+
some(did) { ty = mk_t_with_id(cx, get(ty).struct, some(did)); }
612+
_ {}
613+
}
610614

611615
// If this is a general type fold, then we need to run it now.
612616
alt fld { fm_general(folder) { ret folder(ty); } _ { ret ty; } }

0 commit comments

Comments
 (0)