Skip to content

Commit 4ee99a1

Browse files
committed
trans::glue: don't generate struct destructors in the free glue
The free glue shouldn't be called for structs, and the drop glue already contains the destructor.
1 parent eadd83d commit 4ee99a1

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
@@ -450,15 +450,6 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
450450
ty::ty_opaque_closure_ptr(ck) => {
451451
closure::make_opaque_cbox_free_glue(bcx, ck, v)
452452
}
453-
ty::ty_struct(did, ref substs) => {
454-
// Call the dtor if there is one
455-
match ty::ty_dtor(bcx.tcx(), did) {
456-
ty::NoDtor => bcx,
457-
ty::TraitDtor(ref dt_id) => {
458-
trans_struct_drop(bcx, t, v, *dt_id, did, substs)
459-
}
460-
}
461-
}
462453
_ => bcx
463454
};
464455
build_return(bcx);

0 commit comments

Comments
 (0)