@@ -518,46 +518,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
518
518
this. write_scalar ( Scalar :: from_uint ( align. bytes ( ) , ptr_size) , dest) ?;
519
519
}
520
520
521
- "unchecked_div" => {
522
- let l = this. read_immediate ( args[ 0 ] ) ?;
523
- let r = this. read_immediate ( args[ 1 ] ) ?;
524
- let rval = r. to_scalar ( ) ?. to_bits ( args[ 1 ] . layout . size ) ?;
525
- if rval == 0 {
526
- throw_ub_format ! ( "Division by 0 in unchecked_div" ) ;
527
- }
528
- this. binop_ignore_overflow ( mir:: BinOp :: Div , l, r, dest) ?;
529
- }
530
-
531
- "unchecked_rem" => {
532
- let l = this. read_immediate ( args[ 0 ] ) ?;
533
- let r = this. read_immediate ( args[ 1 ] ) ?;
534
- let rval = r. to_scalar ( ) ?. to_bits ( args[ 1 ] . layout . size ) ?;
535
- if rval == 0 {
536
- throw_ub_format ! ( "Division by 0 in unchecked_rem" ) ;
537
- }
538
- this. binop_ignore_overflow ( mir:: BinOp :: Rem , l, r, dest) ?;
539
- }
540
-
541
- #[ rustfmt:: skip]
542
- | "unchecked_add"
543
- | "unchecked_sub"
544
- | "unchecked_mul"
545
- => {
546
- let l = this. read_immediate ( args[ 0 ] ) ?;
547
- let r = this. read_immediate ( args[ 1 ] ) ?;
548
- let op = match intrinsic_name {
549
- "unchecked_add" => mir:: BinOp :: Add ,
550
- "unchecked_sub" => mir:: BinOp :: Sub ,
551
- "unchecked_mul" => mir:: BinOp :: Mul ,
552
- _ => bug ! ( ) ,
553
- } ;
554
- let ( res, overflowed, _ty) = this. overflowing_binary_op ( op, l, r) ?;
555
- if overflowed {
556
- throw_ub_format ! ( "Overflowing arithmetic in {}" , intrinsic_name) ;
557
- }
558
- this. write_scalar ( res, dest) ?;
559
- }
560
-
561
521
"uninit" => {
562
522
// Check fast path: we don't want to force an allocation in case the destination is a simple value,
563
523
// but we also do not want to create a new allocation with 0s and then copy that over.
0 commit comments