mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 06:03:16 +00:00
allow enums that ref themselves via unsafe pointers
This commit is contained in:
parent
c6d33c3d37
commit
a7e0eb3581
@ -1475,11 +1475,14 @@ fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
|
|||||||
|
|
||||||
ty_box(mt) |
|
ty_box(mt) |
|
||||||
ty_uniq(mt) |
|
ty_uniq(mt) |
|
||||||
ty_ptr(mt) |
|
|
||||||
ty_rptr(_, mt) {
|
ty_rptr(_, mt) {
|
||||||
be type_requires(cx, seen, r_ty, mt.ty);
|
be type_requires(cx, seen, r_ty, mt.ty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ty_ptr(mt) {
|
||||||
|
false // unsafe ptrs can always be NULL
|
||||||
|
}
|
||||||
|
|
||||||
ty_rec(fields) {
|
ty_rec(fields) {
|
||||||
vec::any(fields) {|field|
|
vec::any(fields) {|field|
|
||||||
type_requires(cx, seen, r_ty, field.mt.ty)
|
type_requires(cx, seen, r_ty, field.mt.ty)
|
||||||
|
Loading…
Reference in New Issue
Block a user