]> git.lizzy.rs Git - rust.git/commitdiff
Fix cargo features for nightly (#155)
authorCaleb Zulawski <caleb.zulawski@gmail.com>
Thu, 9 Sep 2021 00:01:16 +0000 (20:01 -0400)
committerGitHub <noreply@github.com>
Thu, 9 Sep 2021 00:01:16 +0000 (17:01 -0700)
* Fix cargo features for nightly

.github/workflows/ci.yml
crates/core_simd/Cargo.toml
crates/core_simd/src/lib.rs
crates/core_simd/src/masks.rs
crates/core_simd/src/masks/bitmask.rs
crates/core_simd/src/masks/full_masks.rs
crates/core_simd/tests/masks.rs
crates/core_simd/tests/to_bytes.rs

index 454bc315475161315d92f9f2705abd805a5ce865..a9768f53852cd4a06695885c51b41a68068d36a7 100644 (file)
@@ -208,8 +208,8 @@ jobs:
         features:
           - ""
           - "--features std"
-          - "--features const_evaluatable_checked"
-          - "--features std --features const_evaluatable_checked"
+          - "--features generic_const_exprs"
+          - "--features std --features generic_const_exprs"
 
     steps:
       - uses: actions/checkout@v2
index c45dde2dbd21d3e68b809fe2f5f2dd19baf781c9..9e8d742d83c72967f2c7e5da929cbc821318df22 100644 (file)
@@ -9,9 +9,9 @@ categories = ["hardware-support", "no-std"]
 license = "MIT OR Apache-2.0"
 
 [features]
-default = ["std", "const_evaluatable_checked"]
+default = ["std", "generic_const_exprs"]
 std = []
-const_evaluatable_checked = []
+generic_const_exprs = []
 
 [target.'cfg(target_arch = "wasm32")'.dev-dependencies.wasm-bindgen]
 version = "0.2"
index fc0df1813b9467284ed8772e9b5c4a6375f646f8..7f07aa6393e2a751bf83c35403afca1b629758fb 100644 (file)
@@ -1,15 +1,15 @@
-#![no_std]
+#![cfg_attr(not(feature = "std"), no_std)]
 #![allow(incomplete_features)]
 #![feature(
-    const_evaluatable_checked,
+    adt_const_params,
     const_fn_trait_bound,
-    const_generics,
     platform_intrinsics,
     repr_simd,
     simd_ffi,
     staged_api,
     stdsimd
 )]
+#![cfg_attr(feature = "generic_const_exprs", feature(generic_const_exprs))]
 #![warn(missing_docs)]
 #![unstable(feature = "portable_simd", issue = "86656")]
 //! Portable SIMD module.
@@ -22,7 +22,7 @@
 mod select;
 pub use select::Select;
 
-#[cfg(feature = "const_evaluatable_checked")]
+#[cfg(feature = "generic_const_exprs")]
 mod to_bytes;
 
 mod comparisons;
index 14b1fe08ffbd1fa8fe6608a1907d20231d8f8a47..ebd394cd0408af2895cc88493439219c925a491a 100644 (file)
@@ -178,11 +178,13 @@ pub fn set(&mut self, lane: usize, value: bool) {
     }
 
     /// Convert this mask to a bitmask, with one bit set per lane.
+    #[cfg(feature = "generic_const_exprs")]
     pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
         self.0.to_bitmask()
     }
 
     /// Convert a bitmask to a mask.
+    #[cfg(feature = "generic_const_exprs")]
     pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
         Self(mask_impl::Mask::from_bitmask(bitmask))
     }
index 0b5b3a5c595eb98caef755a0bec44853bbf9753f..bc68b5076748dc91f28852fed566bdaa04be7f04 100644 (file)
@@ -119,12 +119,14 @@ pub unsafe fn from_int_unchecked(value: Simd<T, LANES>) -> Self {
         Self(core::mem::transmute_copy(&mask), PhantomData)
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
         // Safety: these are the same type and we are laundering the generic
         unsafe { core::mem::transmute_copy(&self.0) }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
         // Safety: these are the same type and we are laundering the generic
index 9c1cc4623f9a84115566147668e15f04a07afcab..5b783a7b6a1234cabd9e43a923fa3648d8af1fb5 100644 (file)
@@ -101,6 +101,7 @@ pub fn convert<U>(self) -> Mask<U, LANES>
         unsafe { Mask(crate::intrinsics::simd_cast(self.0)) }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
         unsafe {
@@ -127,6 +128,7 @@ pub fn convert<U>(self) -> Mask<U, LANES>
         }
     }
 
+    #[cfg(feature = "generic_const_exprs")]
     #[inline]
     pub fn from_bitmask(mut bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
         unsafe {
index cf8039d153d565ce7bb0323b9e8f720f7bebad1f..c2d400d79d4915534d5522a149757011a1e8bcec 100644 (file)
@@ -68,6 +68,7 @@ fn roundtrip_int_conversion() {
                 assert_eq!(core_simd::Mask::<$type, 8>::from_int(int), mask);
             }
 
+            #[cfg(feature = "generic_const_exprs")]
             #[test]
             fn roundtrip_bitmask_conversion() {
                 let values = [
index c66c9d5bd36f59510e1905cbe12b85cdce9201e0..debb4335e2c9672d3b9c609f4290c1adcbc8addb 100644 (file)
@@ -1,6 +1,6 @@
-#![feature(portable_simd, const_generics, const_evaluatable_checked)]
+#![feature(portable_simd, generic_const_exprs, adt_const_params)]
 #![allow(incomplete_features)]
-#![cfg(feature = "const_evaluatable_checked")]
+#![cfg(feature = "generic_const_exprs")]
 
 use core_simd::Simd;