diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2024-02-17 11:18:31 -0500 |
|---|---|---|
| committer | Caleb Zulawski <caleb.zulawski@gmail.com> | 2024-02-17 11:18:31 -0500 |
| commit | 44b4d26273e6d18dcd6bbadd66e793c229e89a59 (patch) | |
| tree | 940726bc38e625f514cc8d928afb8d3f844bd395 | |
| parent | 061d5acd93b93883f4e1bf680cb50a57141be07b (diff) | |
| download | rust-44b4d26273e6d18dcd6bbadd66e793c229e89a59.tar.gz rust-44b4d26273e6d18dcd6bbadd66e793c229e89a59.zip | |
Revert "Revert "Merge pull request #385 from workingjubilee/make-an-ass-out-of-u-and-me""
This reverts commit 644bdfb2ac810c788300bfd79fcc0e0ec84cda5f.
| -rw-r--r-- | crates/core_simd/src/masks.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs index aad91d7acb7..ad7c68fc7f6 100644 --- a/crates/core_simd/src/masks.rs +++ b/crates/core_simd/src/masks.rs @@ -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 |
