From f4ee1ab71174329e04af88370948e08a11c668a5 Mon Sep 17 00:00:00 2001 From: Caleb Zulawski Date: Sat, 20 May 2023 17:28:05 -0400 Subject: [PATCH] Simplify to_int_unchecked --- crates/core_simd/src/elements/float.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/core_simd/src/elements/float.rs b/crates/core_simd/src/elements/float.rs index f6f6f51de53..70b18eee0c0 100644 --- a/crates/core_simd/src/elements/float.rs +++ b/crates/core_simd/src/elements/float.rs @@ -56,10 +56,9 @@ pub trait SimdFloat: Copy + Sealed { /// which saturates on conversion. /// /// [cast]: Simd::cast - unsafe fn to_int_unchecked(self) -> Self::Cast + unsafe fn to_int_unchecked(self) -> Self::Cast where - Self::Scalar: core::convert::FloatToInt + SimdCast, - I: SimdCast; + Self::Scalar: core::convert::FloatToInt; /// Raw transmutation to an unsigned integer vector type with the /// same size and number of lanes. @@ -263,10 +262,9 @@ fn cast(self) -> Self::Cast #[inline] #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces - unsafe fn to_int_unchecked(self) -> Self::Cast + unsafe fn to_int_unchecked(self) -> Self::Cast where - Self::Scalar: core::convert::FloatToInt + SimdCast, - I: SimdCast, + Self::Scalar: core::convert::FloatToInt, { // Safety: supported types are guaranteed by SimdCast, the caller is responsible for the extra invariants unsafe { intrinsics::simd_cast(self) }