Skip to content

Commit 16448e6

Browse files
committed
Document allowed vector lengths
1 parent 6ffafb9 commit 16448e6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

crates/core_simd/src/masks.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ impl_element! { isize, usize }
118118
/// The layout of this type is unspecified, and may change between platforms
119119
/// and/or Rust versions, and code should not assume that it is equivalent to
120120
/// `[T; N]`.
121+
///
122+
/// `N` cannot be 0 and may be at most 64.
121123
#[repr(transparent)]
122124
pub struct Mask<T, const N: usize>(Simd<T, N>)
123125
where

crates/core_simd/src/vector.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ use crate::simd::{
5151
/// Thus it is sound to [`transmute`] `Simd<T, N>` to `[T; N]` and should optimize to "zero cost",
5252
/// but the reverse transmutation may require a copy the compiler cannot simply elide.
5353
///
54+
/// `N` cannot be 0 and may be at most 64.
55+
///
5456
/// # ABI "Features"
5557
/// Due to Rust's safety guarantees, `Simd<T, N>` is currently passed and returned via memory,
5658
/// not SIMD registers, except as an optimization. Using `#[inline]` on functions that accept

0 commit comments

Comments
 (0)