auto merge of #7159 : Blei/rust/free-glue-no-destructor, r=graydon

The free glue shouldn't be called for structs, and the drop glue already
contains the destructor.
This commit is contained in:
bors 2013-06-16 04:40:01 -07:00
commit 03dff61d99

View File

@ -419,15 +419,6 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
ty::ty_opaque_closure_ptr(ck) => {
closure::make_opaque_cbox_free_glue(bcx, ck, v)
}
ty::ty_struct(did, ref substs) => {
// Call the dtor if there is one
match ty::ty_dtor(bcx.tcx(), did) {
ty::NoDtor => bcx,
ty::TraitDtor(ref dt_id) => {
trans_struct_drop(bcx, t, v, *dt_id, did, substs)
}
}
}
_ => bcx
};
build_return(bcx);