Skip to content

Commit

Permalink
Revert "Revert "Merge pull request rust-lang#385 from workingjubilee/…
Browse files Browse the repository at this point in the history
…make-an-ass-out-of-u-and-me""

This reverts commit 644bdfb.
  • Loading branch information
calebzulawski committed Feb 17, 2024
1 parent 061d5ac commit 44b4d26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/core_simd/src/masks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ where
#[must_use = "method returns a new mask and does not mutate the original value"]
pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
// Safety: the caller must confirm this invariant
unsafe { Self(mask_impl::Mask::from_int_unchecked(value)) }
unsafe {
core::intrinsics::assume(<T as Sealed>::valid(value));
Self(mask_impl::Mask::from_int_unchecked(value))
}
}

/// Converts a vector of integers to a mask, where 0 represents `false` and -1
Expand Down

0 comments on commit 44b4d26

Please sign in to comment.