Skip to content

Commit 193af3d

Browse files
committed
Document allowed vector lengths
1 parent 6ffafb9 commit 193af3d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/core_simd/src/masks.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ 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. This limit may be increased in
123+
/// the future.
121124
#[repr(transparent)]
122125
pub struct Mask<T, const N: usize>(Simd<T, N>)
123126
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. This limit may be increased in the future.
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)