about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/core_simd/src/masks.rs4
-rw-r--r--crates/core_simd/src/masks/bitmask.rs4
-rw-r--r--crates/core_simd/src/masks/full_masks.rs7
-rw-r--r--crates/core_simd/src/masks/to_bitmask.rs3
-rw-r--r--crates/core_simd/tests/masks.rs1
5 files changed, 15 insertions, 4 deletions
diff --git a/crates/core_simd/src/masks.rs b/crates/core_simd/src/masks.rs
index e65548a3287..11d7288eccb 100644
--- a/crates/core_simd/src/masks.rs
+++ b/crates/core_simd/src/masks.rs
@@ -13,10 +13,10 @@
 mod mask_impl;
 
 mod to_bitmask;
-pub use to_bitmask::{ToBitMask, ToBitMaskArray};
+pub use to_bitmask::ToBitMask;
 
 #[cfg(feature = "generic_const_exprs")]
-pub use to_bitmask::bitmask_len;
+pub use to_bitmask::{bitmask_len, ToBitMaskArray};
 
 use crate::simd::{intrinsics, LaneCount, Simd, SimdElement, SimdPartialEq, SupportedLaneCount};
 use core::cmp::Ordering;
diff --git a/crates/core_simd/src/masks/bitmask.rs b/crates/core_simd/src/masks/bitmask.rs
index 2e2c0a45c51..365ecc0a325 100644
--- a/crates/core_simd/src/masks/bitmask.rs
+++ b/crates/core_simd/src/masks/bitmask.rs
@@ -1,7 +1,7 @@
 #![allow(unused_imports)]
 use super::MaskElement;
 use crate::simd::intrinsics;
-use crate::simd::{LaneCount, Simd, SupportedLaneCount, ToBitMask, ToBitMaskArray};
+use crate::simd::{LaneCount, Simd, SupportedLaneCount, ToBitMask};
 use core::marker::PhantomData;
 
 /// A mask where each lane is represented by a single bit.
@@ -115,6 +115,7 @@ where
         unsafe { Self(intrinsics::simd_bitmask(value), PhantomData) }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     #[must_use = "method returns a new array and does not mutate the original value"]
     pub fn to_bitmask_array<const N: usize>(self) -> [u8; N] {
@@ -124,6 +125,7 @@ where
         unsafe { core::mem::transmute_copy(&self.0) }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     #[must_use = "method returns a new mask and does not mutate the original value"]
     pub fn from_bitmask_array<const N: usize>(bitmask: [u8; N]) -> Self {
diff --git a/crates/core_simd/src/masks/full_masks.rs b/crates/core_simd/src/masks/full_masks.rs
index b1c3b2b88ad..7ed844de625 100644
--- a/crates/core_simd/src/masks/full_masks.rs
+++ b/crates/core_simd/src/masks/full_masks.rs
@@ -2,7 +2,10 @@
 
 use super::MaskElement;
 use crate::simd::intrinsics;
-use crate::simd::{LaneCount, Simd, SupportedLaneCount, ToBitMask, ToBitMaskArray};
+use crate::simd::{LaneCount, Simd, SupportedLaneCount, ToBitMask};
+
+#[cfg(feature = "generic_const_exprs")]
+use crate::simd::ToBitMaskArray;
 
 #[repr(transparent)]
 pub struct Mask<T, const LANES: usize>(Simd<T, LANES>)
@@ -139,6 +142,7 @@ where
         unsafe { Mask(intrinsics::simd_cast(self.0)) }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     #[must_use = "method returns a new array and does not mutate the original value"]
     pub fn to_bitmask_array<const N: usize>(self) -> [u8; N]
@@ -171,6 +175,7 @@ where
         }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     #[must_use = "method returns a new mask and does not mutate the original value"]
     pub fn from_bitmask_array<const N: usize>(mut bitmask: [u8; N]) -> Self
diff --git a/crates/core_simd/src/masks/to_bitmask.rs b/crates/core_simd/src/masks/to_bitmask.rs
index ee229fc7a44..954f88ea511 100644
--- a/crates/core_simd/src/masks/to_bitmask.rs
+++ b/crates/core_simd/src/masks/to_bitmask.rs
@@ -38,6 +38,7 @@ pub unsafe trait ToBitMask: Sealed {
 /// # Safety
 /// This trait is `unsafe` and sealed, since the `BYTES` value must match the number of lanes in
 /// the mask.
+#[cfg(feature = "generic_const_exprs")]
 pub unsafe trait ToBitMaskArray: Sealed {
     /// The length of the bitmask array.
     const BYTES: usize;
@@ -78,10 +79,12 @@ impl_integer_intrinsic! {
 }
 
 /// Returns the minimum numnber of bytes in a bitmask with `lanes` lanes.
+#[cfg(feature = "generic_const_exprs")]
 pub const fn bitmask_len(lanes: usize) -> usize {
     (lanes + 7) / 8
 }
 
+#[cfg(feature = "generic_const_exprs")]
 unsafe impl<T: MaskElement, const LANES: usize> ToBitMaskArray for Mask<T, LANES>
 where
     LaneCount<LANES>: SupportedLaneCount,
diff --git a/crates/core_simd/tests/masks.rs b/crates/core_simd/tests/masks.rs
index 6150124b8ca..673d0db93fe 100644
--- a/crates/core_simd/tests/masks.rs
+++ b/crates/core_simd/tests/masks.rs
@@ -123,6 +123,7 @@ macro_rules! test_mask_api {
                 cast_impl::<isize>();
             }
 
+            #[cfg(feature = "generic_const_exprs")]
             #[test]
             fn roundtrip_bitmask_array_conversion() {
                 use core_simd::ToBitMaskArray;