Change type_needs_drop to say that any class w/ a dtor needs a drop
This was preventing dtors from running for class types that didn't have pointer fields.
This commit is contained in:
parent
1e801baa84
commit
bc5cb4deb3
@ -1174,10 +1174,13 @@ fn type_needs_drop(cx: ctxt, ty: t) -> bool {
|
||||
accum
|
||||
}
|
||||
ty_class(did, substs) {
|
||||
for vec::each(ty::class_items_as_fields(cx, did, substs)) {|f|
|
||||
if type_needs_drop(cx, f.mt.ty) { accum = true; }
|
||||
}
|
||||
accum
|
||||
// Any class with a dtor needs a drop
|
||||
option::is_some(ty_dtor(cx, did)) || {
|
||||
for vec::each(ty::class_items_as_fields(cx, did, substs)) {|f|
|
||||
if type_needs_drop(cx, f.mt.ty) { accum = true; }
|
||||
}
|
||||
accum
|
||||
}
|
||||
}
|
||||
|
||||
ty_tup(elts) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user