Skip to content

Commit 4c51420

Browse files
committed
Fix cargo features
1 parent d428753 commit 4c51420

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

crates/core_simd/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#![no_std]
1+
#![cfg_attr(not(feature = "std"), no_std)]
22
#![allow(incomplete_features)]
33
#![feature(
4-
const_evaluatable_checked,
54
const_fn_trait_bound,
65
const_generics,
76
platform_intrinsics,
@@ -10,6 +9,10 @@
109
staged_api,
1110
stdsimd
1211
)]
12+
#![cfg_attr(
13+
feature = "const_evaluatable_checked",
14+
feature(const_evaluatable_checked)
15+
)]
1316
#![warn(missing_docs)]
1417
#![unstable(feature = "portable_simd", issue = "86656")]
1518
//! Portable SIMD module.

crates/core_simd/src/masks.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,13 @@ where
178178
}
179179

180180
/// Convert this mask to a bitmask, with one bit set per lane.
181+
#[cfg(feature = "const_evaluatable_checked")]
181182
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
182183
self.0.to_bitmask()
183184
}
184185

185186
/// Convert a bitmask to a mask.
187+
#[cfg(feature = "const_evaluatable_checked")]
186188
pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
187189
Self(mask_impl::Mask::from_bitmask(bitmask))
188190
}

crates/core_simd/src/masks/bitmask.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,14 @@ where
119119
Self(core::mem::transmute_copy(&mask), PhantomData)
120120
}
121121

122+
#[cfg(feature = "const_evaluatable_checked")]
122123
#[inline]
123124
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
124125
// Safety: these are the same type and we are laundering the generic
125126
unsafe { core::mem::transmute_copy(&self.0) }
126127
}
127128

129+
#[cfg(feature = "const_evaluatable_checked")]
128130
#[inline]
129131
pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
130132
// Safety: these are the same type and we are laundering the generic

crates/core_simd/src/masks/full_masks.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ where
101101
unsafe { Mask(crate::intrinsics::simd_cast(self.0)) }
102102
}
103103

104+
#[cfg(feature = "const_evaluatable_checked")]
104105
#[inline]
105106
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
106107
unsafe {
@@ -127,6 +128,7 @@ where
127128
}
128129
}
129130

131+
#[cfg(feature = "const_evaluatable_checked")]
130132
#[inline]
131133
pub fn from_bitmask(mut bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
132134
unsafe {

crates/core_simd/tests/masks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ macro_rules! test_mask_api {
6868
assert_eq!(core_simd::Mask::<$type, 8>::from_int(int), mask);
6969
}
7070

71+
#[cfg(feature = "const_evaluatable_checked")]
7172
#[test]
7273
fn roundtrip_bitmask_conversion() {
7374
let values = [

0 commit comments

Comments
 (0)