Skip to content

Commit 8cf7a62

Browse files
Fix cargo features for nightly (rust-lang#155)
* Fix cargo features for nightly
1 parent d428753 commit 8cf7a62

File tree

8 files changed

+17
-10
lines changed

8 files changed

+17
-10
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ jobs:
208208
features:
209209
- ""
210210
- "--features std"
211-
- "--features const_evaluatable_checked"
212-
- "--features std --features const_evaluatable_checked"
211+
- "--features generic_const_exprs"
212+
- "--features std --features generic_const_exprs"
213213

214214
steps:
215215
- uses: actions/checkout@v2

crates/core_simd/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ categories = ["hardware-support", "no-std"]
99
license = "MIT OR Apache-2.0"
1010

1111
[features]
12-
default = ["std", "const_evaluatable_checked"]
12+
default = ["std", "generic_const_exprs"]
1313
std = []
14-
const_evaluatable_checked = []
14+
generic_const_exprs = []
1515

1616
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.wasm-bindgen]
1717
version = "0.2"

crates/core_simd/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#![no_std]
1+
#![cfg_attr(not(feature = "std"), no_std)]
22
#![allow(incomplete_features)]
33
#![feature(
4-
const_evaluatable_checked,
4+
adt_const_params,
55
const_fn_trait_bound,
6-
const_generics,
76
platform_intrinsics,
87
repr_simd,
98
simd_ffi,
109
staged_api,
1110
stdsimd
1211
)]
12+
#![cfg_attr(feature = "generic_const_exprs", feature(generic_const_exprs))]
1313
#![warn(missing_docs)]
1414
#![unstable(feature = "portable_simd", issue = "86656")]
1515
//! Portable SIMD module.
@@ -22,7 +22,7 @@ mod reduction;
2222
mod select;
2323
pub use select::Select;
2424

25-
#[cfg(feature = "const_evaluatable_checked")]
25+
#[cfg(feature = "generic_const_exprs")]
2626
mod to_bytes;
2727

2828
mod comparisons;

crates/core_simd/src/masks.rs

+2
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 = "generic_const_exprs")]
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 = "generic_const_exprs")]
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

+2
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 = "generic_const_exprs")]
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 = "generic_const_exprs")]
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

+2
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 = "generic_const_exprs")]
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 = "generic_const_exprs")]
130132
#[inline]
131133
pub fn from_bitmask(mut bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
132134
unsafe {

crates/core_simd/tests/masks.rs

+1
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 = "generic_const_exprs")]
7172
#[test]
7273
fn roundtrip_bitmask_conversion() {
7374
let values = [

crates/core_simd/tests/to_bytes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#![feature(portable_simd, const_generics, const_evaluatable_checked)]
1+
#![feature(portable_simd, generic_const_exprs, adt_const_params)]
22
#![allow(incomplete_features)]
3-
#![cfg(feature = "const_evaluatable_checked")]
3+
#![cfg(feature = "generic_const_exprs")]
44

55
use core_simd::Simd;
66

0 commit comments

Comments
 (0)