Skip to content

Commit 03dff61

Browse files
committed
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.
2 parents d1a2360 + 4ee99a1 commit 03dff61

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/librustc/middle/trans/glue.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,6 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
419419
ty::ty_opaque_closure_ptr(ck) => {
420420
closure::make_opaque_cbox_free_glue(bcx, ck, v)
421421
}
422-
ty::ty_struct(did, ref substs) => {
423-
// Call the dtor if there is one
424-
match ty::ty_dtor(bcx.tcx(), did) {
425-
ty::NoDtor => bcx,
426-
ty::TraitDtor(ref dt_id) => {
427-
trans_struct_drop(bcx, t, v, *dt_id, did, substs)
428-
}
429-
}
430-
}
431422
_ => bcx
432423
};
433424
build_return(bcx);

0 commit comments

Comments
 (0)