allow enums that ref themselves via unsafe pointers

This commit is contained in:
Niko Matsakis 2012-05-03 17:07:57 -07:00
parent c6d33c3d37
commit a7e0eb3581

View File

@ -1475,11 +1475,14 @@ fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
ty_box(mt) |
ty_uniq(mt) |
ty_ptr(mt) |
ty_rptr(_, mt) {
be type_requires(cx, seen, r_ty, mt.ty);
}
ty_ptr(mt) {
false // unsafe ptrs can always be NULL
}
ty_rec(fields) {
vec::any(fields) {|field|
type_requires(cx, seen, r_ty, field.mt.ty)