Make sure fold_ty preserves associated def_ids

Closes #1884
This commit is contained in:
Marijn Haverbeke 2012-02-23 17:44:03 +01:00
parent 0f00d9a797
commit 8733386bcc

View file

@ -607,6 +607,10 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
cx.sess.fatal("Unsupported sort of type in fold_ty");
}
}
alt tb.o_def_id {
some(did) { ty = mk_t_with_id(cx, get(ty).struct, some(did)); }
_ {}
}
// If this is a general type fold, then we need to run it now.
alt fld { fm_general(folder) { ret folder(ty); } _ { ret ty; } }