X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_trans%2Ftrans%2Fbase.rs;h=9e561fc883bb043366e5c7de7198d9863b5e3323;hb=7335c7dd63cafe70ffca76677f9e33bc6eccefaa;hp=e4077f26ba89882cc4069add4bb66d5f52d06cef;hpb=3484706c38272828efc50b2553578afc62230dbb;p=rust.git diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index e4077f26ba8..9e561fc883b 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -2019,7 +2019,11 @@ pub fn trans_named_tuple_constructor<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, let bcx = match dest { expr::SaveIn(_) => bcx, expr::Ignore => { - glue::drop_ty(bcx, llresult, result_ty, debug_loc) + let bcx = glue::drop_ty(bcx, llresult, result_ty, debug_loc); + if !type_is_zero_size(ccx, result_ty) { + call_lifetime_end(bcx, llresult); + } + bcx } };