Skip to content

Commit c460d6d

Browse files
committed
derive Arbitrary on Simd<T, N>
1 parent 9ec07c8 commit c460d6d

File tree

1 file changed

+4
-0
lines changed
  • library/portable-simd/crates/core_simd/src

1 file changed

+4
-0
lines changed

library/portable-simd/crates/core_simd/src/vector.rs

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ use crate::simd::{
55
ptr::{SimdConstPtr, SimdMutPtr},
66
};
77

8+
#[cfg(kani)]
9+
use crate::kani;
10+
811
/// A SIMD vector with the shape of `[T; N]` but the operations of `T`.
912
///
1013
/// `Simd<T, N>` supports the operators (+, *, etc.) that `T` does in "elementwise" fashion.
@@ -100,6 +103,7 @@ use crate::simd::{
100103
// avoided, as it will likely become illegal on `#[repr(simd)]` structs in the future. It also
101104
// causes rustc to emit illegal LLVM IR in some cases.
102105
#[repr(simd, packed)]
106+
#[cfg_attr(kani, derive(kani::Arbitrary))]
103107
pub struct Simd<T, const N: usize>([T; N])
104108
where
105109
LaneCount<N>: SupportedLaneCount,

0 commit comments

Comments
 (0)