Skip to content

Commit afe28b1

Browse files
committed
Add various bounds
1 parent b411cb4 commit afe28b1

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

crates/core_simd/src/masks/to_bitmask.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use super::{mask_impl, Mask, MaskElement};
22
use crate::simd::{LaneCount, SupportedLaneCount};
3+
use core::borrow::{Borrow, BorrowMut};
34

45
mod sealed {
56
pub trait Sealed {}
@@ -32,7 +33,15 @@ pub trait ToBitMask: Sealed {
3233
/// Each bit of the bitmask corresponds to a mask lane, starting with the LSB of the first byte.
3334
pub trait ToBitMaskArray: Sealed {
3435
/// The bitmask array.
35-
type BitMaskArray;
36+
type BitMaskArray: Copy
37+
+ Unpin
38+
+ Send
39+
+ Sync
40+
+ AsRef<[u8]>
41+
+ AsMut<[u8]>
42+
+ Borrow<[u8]>
43+
+ BorrowMut<[u8]>
44+
+ 'static;
3645

3746
/// Converts a mask to a bitmask.
3847
fn to_bitmask_array(self) -> Self::BitMaskArray;

crates/core_simd/src/to_bytes.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ use sealed::Sealed;
1010
/// Convert SIMD vectors to vectors of bytes
1111
pub trait ToBytes: Sealed {
1212
/// This type, reinterpreted as bytes.
13-
type Bytes;
13+
type Bytes: Copy
14+
+ Unpin
15+
+ Send
16+
+ Sync
17+
+ AsRef<[u8]>
18+
+ AsMut<[u8]>
19+
+ SimdUint<Scalar = u8>
20+
+ 'static;
1421

1522
/// Return the memory representation of this integer as a byte array in native byte
1623
/// order.

0 commit comments

Comments
 (0)