Skip to content

Commit a7e0eb3

Browse files
committed
allow enums that ref themselves via unsafe pointers
1 parent c6d33c3 commit a7e0eb3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rustc/middle/ty.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,11 +1475,14 @@ fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
14751475

14761476
ty_box(mt) |
14771477
ty_uniq(mt) |
1478-
ty_ptr(mt) |
14791478
ty_rptr(_, mt) {
14801479
be type_requires(cx, seen, r_ty, mt.ty);
14811480
}
14821481

1482+
ty_ptr(mt) {
1483+
false // unsafe ptrs can always be NULL
1484+
}
1485+
14831486
ty_rec(fields) {
14841487
vec::any(fields) {|field|
14851488
type_requires(cx, seen, r_ty, field.mt.ty)

0 commit comments

Comments
 (0)