We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 061d5ac commit 44b4d26Copy full SHA for 44b4d26
crates/core_simd/src/masks.rs
@@ -174,7 +174,10 @@ where
174
#[must_use = "method returns a new mask and does not mutate the original value"]
175
pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
176
// Safety: the caller must confirm this invariant
177
- unsafe { Self(mask_impl::Mask::from_int_unchecked(value)) }
+ unsafe {
178
+ core::intrinsics::assume(<T as Sealed>::valid(value));
179
+ Self(mask_impl::Mask::from_int_unchecked(value))
180
+ }
181
}
182
183
/// Converts a vector of integers to a mask, where 0 represents `false` and -1
0 commit comments