diff --git a/src/librustc_trans/trans/mir/lvalue.rs b/src/librustc_trans/trans/mir/lvalue.rs index a8c67549380..ffc3b120674 100644 --- a/src/librustc_trans/trans/mir/lvalue.rs +++ b/src/librustc_trans/trans/mir/lvalue.rs @@ -51,7 +51,9 @@ impl<'tcx> LvalueRef<'tcx> { { assert!(!ty.has_erasable_regions()); let lltemp = bcx.with_block(|bcx| base::alloc_ty(bcx, ty, name)); - drop::drop_fill(bcx, lltemp, ty); + if bcx.fcx().type_needs_drop(ty) { + drop::drop_fill(bcx, lltemp, ty); + } LvalueRef::new_sized(lltemp, LvalueTy::from_ty(ty)) } }