1
Fork 0

don't force allocate for ReifyFnPointer casts

This commit is contained in:
Oliver Schneider 2016-10-21 14:54:37 +02:00
parent 512f344a3b
commit eb08a2e646
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46

View file

@ -687,10 +687,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
ReifyFnPointer => match self.operand_ty(operand).sty {
ty::TyFnDef(def_id, substs, fn_ty) => {
// FIXME(solson)
let dest = self.force_allocation(dest)?.to_ptr();
let fn_ptr = self.memory.create_fn_ptr(def_id, substs, fn_ty);
self.memory.write_ptr(dest, fn_ptr)?;
self.write_value(Value::ByVal(PrimVal::from_fn_ptr(fn_ptr)), dest, dest_ty)?;
},
ref other => bug!("reify fn pointer on {:?}", other),
},