Don't build a ty::Const just to take it apart again

This commit is contained in:
Oli Scherer 2021-03-11 14:51:09 +00:00
parent 5b6ddd5026
commit c0e1191807

View File

@ -171,8 +171,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
};
let val =
self.tcx.const_eval_global_id(self.param_env, gid, Some(self.tcx.span))?;
let const_ = ty::Const { val: ty::ConstKind::Value(val), ty };
let val = self.const_to_op(&const_, None)?;
let val = self.const_val_to_op(val, ty, None)?;
self.copy_op(&val, dest)?;
}