Don't build a ty::Const just to take it apart again
This commit is contained in:
parent
5b6ddd5026
commit
c0e1191807
@ -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)?;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user