add cfg(nightly) attribute

This commit is contained in:
do butterflies cry? 2026-03-29 00:01:11 +10:00
parent 6ebb4de45b
commit b0bfbf147a
Signed by: cry
GPG key ID: F68745A836CA0412

15
nixide/build.rs Normal file
View file

@ -0,0 +1,15 @@
use std::env;
fn main() {
// allow the `cfg(nightly)` attribute
println!("cargo::rustc-check-cfg=cfg(nightly)");
// NOTE: This allows nixide to conditionally compile based
// NOTE: whether a user has access to nightly features.
if let Ok(toolchain) = env::var("RUSTUP_TOOLCHAIN")
&& toolchain.contains("nightly")
{
// enable the `nightly` flag
println!("cargo::rustc-cfg=nightly");
}
}