fix a sized deallocation issue in the glue code

This commit is contained in:
Daniel Micay 2014-09-04 23:58:39 -04:00
parent 6eabd85265
commit 395e453c06

View File

@ -111,9 +111,6 @@ pub fn get_drop_glue_type(ccx: &CrateContext, t: ty::t) -> ty::t {
return ty::mk_i8();
}
match ty::get(t).sty {
ty::ty_box(typ) if !ty::type_needs_drop(tcx, typ) =>
ty::mk_box(tcx, ty::mk_i8()),
ty::ty_uniq(typ) if !ty::type_needs_drop(tcx, typ)
&& ty::type_is_sized(tcx, typ) => {
let llty = sizing_type_of(ccx, typ);
@ -121,7 +118,7 @@ pub fn get_drop_glue_type(ccx: &CrateContext, t: ty::t) -> ty::t {
if llsize_of_alloc(ccx, llty) == 0 {
ty::mk_i8()
} else {
ty::mk_uniq(tcx, ty::mk_i8())
t
}
}
_ => t