From b0bfbf147a720e1a3ea6a2450774ea130d388be1 Mon Sep 17 00:00:00 2001 From: _cry64 Date: Sun, 29 Mar 2026 00:01:11 +1000 Subject: [PATCH] add cfg(nightly) attribute --- nixide/build.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 nixide/build.rs diff --git a/nixide/build.rs b/nixide/build.rs new file mode 100644 index 0000000..c34d709 --- /dev/null +++ b/nixide/build.rs @@ -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"); + } +}