use rustc_version::{version_meta, Channel};

fn main() {
    // Tell rust that nightly flag exists
    println!("cargo::rustc-check-cfg=cfg(nightly)");
    if version_meta().unwrap().channel == Channel::Nightly {
        // … and set it for nightly.
        println!("cargo:rustc-cfg=nightly");
    }
}
