You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using nightly channel but with limited features which results in compilation failure.
$ export RUSTFLAGS=-Zallow-features=
$ rustup run nightly cargo build
Error message:
error[E0725]: the feature `min_specialization` is not in the list of allowed features
--> src/lib.rs:42:45
|
42 | #![cfg_attr(feature = "specialize", feature(min_specialization))]
| ^^^^^^^^^^^^^^^^^^
error[E0725]: the feature `stdsimd` is not in the list of allowed features
--> src/lib.rs:43:42
|
43 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
diff --git a/build.rs b/build.rs
index 8be4964..0738275 100644
--- a/build.rs
+++ b/build.rs
@@ -4,11 +4,11 @@ use std::env;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
- if let Some(channel) = version_check::Channel::read() {
- if channel.supports_features() {
- println!("cargo:rustc-cfg=feature=\"specialize\"");
- println!("cargo:rustc-cfg=feature=\"stdsimd\"");
- }
+ if let Some(true) = version_check::supports_feature("specialize") {
+ println!("cargo:rustc-cfg=feature=\"specialize\"");
+ }
+ if let Some(true) = version_check::supports_feature("stdsimd") {
+ println!("cargo:rustc-cfg=feature=\"stdsimd\"");
}
let os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS was not set");
if os.eq_ignore_ascii_case("linux")
Please make changes to avoid this failure.
The text was updated successfully, but these errors were encountered:
We are using nightly channel but with limited features which results in compilation failure.
Error message:
https://docs.rs/version_check/latest/version_check/fn.supports_feature.html was proposed by one my colleague to solve this. I tried it and it seems to work.
Please make changes to avoid this failure.
The text was updated successfully, but these errors were encountered: