Sun, 27 Apr 2025 20:29:43 -0500
Fix build with stable rust.
For optimisations, build.rs now automatically sets a nightly cfg flag,
so problems with the nightly feature are avoided. It is still used for
required for additional nightly-only features.
94 | 1 | use rustc_version::{version_meta, Channel}; |
2 | ||
3 | fn main() { | |
4 | // Tell rust that nightly flag exists | |
5 | println!("cargo::rustc-check-cfg=cfg(nightly)"); | |
6 | if version_meta().unwrap().channel == Channel::Nightly { | |
7 | // … and set it for nightly. | |
8 | println!("cargo:rustc-cfg=nightly"); | |
9 | } | |
10 | } |