We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b2e1bcb + b6eeb4e commit 6ad779cCopy full SHA for 6ad779c
crates/core_simd/src/lib.rs
@@ -6,6 +6,7 @@
6
const_maybe_uninit_as_mut_ptr,
7
const_mut_refs,
8
convert_float_to_int,
9
+ core_intrinsics,
10
decl_macro,
11
inline_const,
12
intra_doc_pointers,
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