-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Hi,
It would be great if i can still use the simd feature, but disable its functionality when not building for nightly.
The simplest way to accomplish this would be in a build script call this:
fn set_nightly_cfg() {
let rustc = std::env::var("RUSTC").unwrap();
let version = std::process::Command::new(rustc)
.arg("--version")
.output()
.unwrap();
assert!(version.status.success());
let stdout = String::from_utf8(version.stdout).unwrap();
assert!(stdout.contains("rustc"));
let nightly = stdout.contains("nightly") || stdout.contains("dev");
if nightly {
println!("cargo:rustc-cfg=rust_nightly");
println!("cargo::rustc-check-cfg=cfg(rust_nightly)");
}
}And simd_portable + simd featues can then be feature gated like:
#![cfg_attr(rust_nightly, feature(portable_simd))]Unfortunately cargo has no way to enable specific features on nightly only
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels