@@ -499,7 +499,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
499499 let bitmask_len = u32:: try_from ( bitmask_len) . unwrap ( ) ;
500500 for i in 0 ..dest_len {
501501 let bit_i = simd_bitmask_index ( i, dest_len, this. data_layout ( ) . endian ) ;
502- let mask = mask & 1u64 . checked_shl ( bit_i) . unwrap ( ) ;
502+ let mask = mask & 1u64 . strict_shl ( bit_i) ;
503503 let yes = this. read_immediate ( & this. project_index ( & yes, i. into ( ) ) ?) ?;
504504 let no = this. read_immediate ( & this. project_index ( & no, i. into ( ) ) ?) ?;
505505 let dest = this. project_index ( & dest, i. into ( ) ) ?;
@@ -511,7 +511,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
511511 // If the mask is "padded", ensure that padding is all-zero.
512512 // This deliberately does not use `simd_bitmask_index`; these bits are outside
513513 // the bitmask. It does not matter in which order we check them.
514- let mask = mask & 1u64 . checked_shl ( i ) . unwrap ( ) ;
514+ let mask = mask & 1u64 . strict_shl ( i ) ;
515515 if mask != 0 {
516516 throw_ub_format ! (
517517 "a SIMD bitmask less than 8 bits long must be filled with 0s for the remaining bits"
@@ -535,9 +535,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
535535 for i in 0 ..op_len {
536536 let op = this. read_immediate ( & this. project_index ( & op, i. into ( ) ) ?) ?;
537537 if simd_element_to_bool ( op) ? {
538- res |= 1u64
539- . checked_shl ( simd_bitmask_index ( i, op_len, this. data_layout ( ) . endian ) )
540- . unwrap ( ) ;
538+ let bit_i = simd_bitmask_index ( i, op_len, this. data_layout ( ) . endian ) ;
539+ res |= 1u64 . strict_shl ( bit_i) ;
541540 }
542541 }
543542 // Write the result, depending on the `dest` type.
@@ -653,8 +652,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
653652
654653 let val = if src_index < left_len {
655654 this. read_immediate ( & this. project_index ( & left, src_index) ?) ?
656- } else if src_index < left_len. checked_add ( right_len) . unwrap ( ) {
657- let right_idx = src_index. checked_sub ( left_len) . unwrap ( ) ;
655+ } else if src_index < left_len. strict_add ( right_len) {
656+ let right_idx = src_index. strict_sub ( left_len) ;
658657 this. read_immediate ( & this. project_index ( & right, right_idx) ?) ?
659658 } else {
660659 throw_ub_format ! (
@@ -693,8 +692,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
693692
694693 let val = if src_index < left_len {
695694 this. read_immediate ( & this. project_index ( & left, src_index) ?) ?
696- } else if src_index < left_len. checked_add ( right_len) . unwrap ( ) {
697- let right_idx = src_index. checked_sub ( left_len) . unwrap ( ) ;
695+ } else if src_index < left_len. strict_add ( right_len) {
696+ let right_idx = src_index. strict_sub ( left_len) ;
698697 this. read_immediate ( & this. project_index ( & right, right_idx) ?) ?
699698 } else {
700699 throw_ub_format ! (
0 commit comments