mir: Don't memset allocas of types that do not require drop.
This commit is contained in:
parent
460e66457a
commit
02a141a550
@ -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))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user