Skip to content

Commit 9eba718

Browse files
committed
Fix cargo features
1 parent 50eb35e commit 9eba718

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,14 +1,17 @@
1-
#![no_std]
1+
#![cfg_attr(not(feature = "std"), no_std)]
22
#![allow(incomplete_features)]
33
#![feature(
4-
const_evaluatable_checked,
54
const_generics,
65
platform_intrinsics,
76
repr_simd,
87
simd_ffi,
98
staged_api,
109
stdsimd
1110
)]
11+
#![cfg_attr(
12+
feature = "const_evaluatable_checked",
13+
feature(const_evaluatable_checked)
14+
)]
1215
#![warn(missing_docs)]
1316
#![unstable(feature = "portable_simd", issue = "86656")]
1417
//! Portable SIMD module.

crates/core_simd/src/masks.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,13 @@ macro_rules! define_opaque_mask {
160160
}
161161

162162
/// Convert this mask to a bitmask, with one bit set per lane.
163+
#[cfg(feature = "const_evaluatable_checked")]
163164
pub fn to_bitmask(self) -> [u8; crate::LaneCount::<LANES>::BITMASK_LEN] {
164165
self.0.to_bitmask()
165166
}
166167

167168
/// Convert a bitmask to a mask.
169+
#[cfg(feature = "const_evaluatable_checked")]
168170
pub fn from_bitmask(bitmask: [u8; crate::LaneCount::<LANES>::BITMASK_LEN]) -> Self {
169171
Self(<$inner_ty>::from_bitmask(bitmask))
170172
}

crates/core_simd/src/masks/bitmask.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,14 @@ where
127127
Self(core::mem::transmute_copy(&mask))
128128
}
129129

130+
#[cfg(feature = "const_evaluatable_checked")]
130131
#[inline]
131132
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
132133
// Safety: these are the same type and we are laundering the generic
133134
unsafe { core::mem::transmute_copy(&self.0) }
134135
}
135136

137+
#[cfg(feature = "const_evaluatable_checked")]
136138
#[inline]
137139
pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
138140
// 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
@@ -102,6 +102,7 @@ macro_rules! define_mask {
102102
Self(value)
103103
}
104104

105+
#[cfg(feature = "const_evaluatable_checked")]
105106
#[inline]
106107
pub fn to_bitmask(self) -> [u8; crate::LaneCount::<LANES>::BITMASK_LEN] {
107108
unsafe {
@@ -126,6 +127,7 @@ macro_rules! define_mask {
126127
}
127128
}
128129

130+
#[cfg(feature = "const_evaluatable_checked")]
129131
#[inline]
130132
pub fn from_bitmask(mut bitmask: [u8; crate::LaneCount::<LANES>::BITMASK_LEN]) -> Self {
131133
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::$name::<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)