Do not force_allocate Box destination.

This commit is contained in:
Scott Olson 2016-10-16 00:12:27 -06:00
parent 197e89bbb0
commit abf3e048ad

View file

@ -635,13 +635,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
}
Box(ty) => {
// FIXME(solson)
let dest = self.force_allocation(dest)?.to_ptr();
let size = self.type_size(ty);
let align = self.type_align(ty);
let ptr = self.memory.allocate(size, align)?;
self.memory.write_ptr(dest, ptr)?;
let ptr = self.alloc_ptr(ty)?;
self.write_primval(dest, PrimVal::Ptr(ptr))?;
}
Cast(kind, ref operand, cast_ty) => {