]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_trans/trans/base.rs
rollup merge of #21830: japaric/for-cleanup
[rust.git] / src / librustc_trans / trans / base.rs
index e4077f26ba89882cc4069add4bb66d5f52d06cef..9e561fc883bb043366e5c7de7198d9863b5e3323 100644 (file)
@@ -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
         }
     };