Skip to content

Commit f4ee1ab

Browse files
committed
Simplify to_int_unchecked
1 parent 6626cd8 commit f4ee1ab

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

crates/core_simd/src/elements/float.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ pub trait SimdFloat: Copy + Sealed {
5656
/// which saturates on conversion.
5757
///
5858
/// [cast]: Simd::cast
59-
unsafe fn to_int_unchecked<I>(self) -> Self::Cast<I>
59+
unsafe fn to_int_unchecked<I: SimdCast>(self) -> Self::Cast<I>
6060
where
61-
Self::Scalar: core::convert::FloatToInt<I> + SimdCast,
62-
I: SimdCast;
61+
Self::Scalar: core::convert::FloatToInt<I>;
6362

6463
/// Raw transmutation to an unsigned integer vector type with the
6564
/// same size and number of lanes.
@@ -263,10 +262,9 @@ macro_rules! impl_trait {
263262

264263
#[inline]
265264
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
266-
unsafe fn to_int_unchecked<I>(self) -> Self::Cast<I>
265+
unsafe fn to_int_unchecked<I: SimdCast>(self) -> Self::Cast<I>
267266
where
268-
Self::Scalar: core::convert::FloatToInt<I> + SimdCast,
269-
I: SimdCast,
267+
Self::Scalar: core::convert::FloatToInt<I>,
270268
{
271269
// Safety: supported types are guaranteed by SimdCast, the caller is responsible for the extra invariants
272270
unsafe { intrinsics::simd_cast(self) }

0 commit comments

Comments
 (0)