diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2021-08-13 20:40:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-13 20:40:05 -0400 |
| commit | cf653c7b9376eb170d0c8db634f5559e3708a87d (patch) | |
| tree | aadbd503df84eef1cdb53a989c46e06acdcf0c20 | |
| parent | 00165ed5beea0dbbbb950afba692b4c804485c03 (diff) | |
| download | rust-cf653c7b9376eb170d0c8db634f5559e3708a87d.tar.gz rust-cf653c7b9376eb170d0c8db634f5559e3708a87d.zip | |
Update crates/core_simd/src/vector.rs
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
| -rw-r--r-- | crates/core_simd/src/vector.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs index 26c9bc0af6e..9b6d0a20ed9 100644 --- a/crates/core_simd/src/vector.rs +++ b/crates/core_simd/src/vector.rs @@ -336,6 +336,11 @@ mod sealed { use sealed::Sealed; /// Marker trait for types that may be used as SIMD vector elements. +/// SAFETY: This trait, when implemented, asserts the compiler can monomorphize +/// `#[repr(simd)]` structs with the marked type as an element. +/// Strictly, it is valid to impl if the vector will not be miscompiled. +/// Practically, it is user-unfriendly to impl it if the vector won't compile, +/// even when no soundness guarantees are broken by allowing the user to try. pub unsafe trait SimdElement: Sealed + Copy { /// The mask element type corresponding to this element type. type Mask: MaskElement; |
