remove unchecked_div/_rem from ctfe

This commit is contained in:
Scott McMurray 2023-06-01 00:05:12 -07:00
parent dc353f13b8
commit 73f104b6d6

View File

@ -233,9 +233,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
| sym::unchecked_shr | sym::unchecked_shr
| sym::unchecked_add | sym::unchecked_add
| sym::unchecked_sub | sym::unchecked_sub
| sym::unchecked_mul | sym::unchecked_mul => {
| sym::unchecked_div
| sym::unchecked_rem => {
let l = self.read_immediate(&args[0])?; let l = self.read_immediate(&args[0])?;
let r = self.read_immediate(&args[1])?; let r = self.read_immediate(&args[1])?;
let bin_op = match intrinsic_name { let bin_op = match intrinsic_name {
@ -244,8 +242,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
sym::unchecked_add => BinOp::Add, sym::unchecked_add => BinOp::Add,
sym::unchecked_sub => BinOp::Sub, sym::unchecked_sub => BinOp::Sub,
sym::unchecked_mul => BinOp::Mul, sym::unchecked_mul => BinOp::Mul,
sym::unchecked_div => BinOp::Div,
sym::unchecked_rem => BinOp::Rem,
_ => bug!(), _ => bug!(),
}; };
let (val, overflowed, _ty) = self.overflowing_binary_op(bin_op, &l, &r)?; let (val, overflowed, _ty) = self.overflowing_binary_op(bin_op, &l, &r)?;