mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
remove unchecked_div/_rem from ctfe
This commit is contained in:
parent
dc353f13b8
commit
73f104b6d6
@ -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)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user