anystack 0.6.0-alpha.3

Flexible and comprehensive error handling.
Documentation
use rustc_version::{version_meta, Channel};

fn main() {
    let version_meta = version_meta().expect("Could not get Rust version");

    println!("cargo:rustc-check-cfg=cfg(nightly)");
    println!("cargo:rustc-check-cfg=cfg(beta)");
    println!("cargo:rustc-check-cfg=cfg(stable)");
    if version_meta.channel == Channel::Nightly {
        println!("cargo:rustc-cfg=nightly");
    } else if version_meta.channel == Channel::Beta {
        println!("cargo:rustc-cfg=beta");
    } else if version_meta.channel == Channel::Stable {
        println!("cargo:rustc-cfg=stable");
    }

    // Currently not used, but helpful for future reference
    //
    // let rustc_version = version_meta.semver;
    // let trimmed_rustc_version = Version::new(
    //     rustc_version.major,
    //     rustc_version.minor,
    //     rustc_version.patch,
    // );
    //
    // println!("cargo:rustc-check-cfg=cfg(rust_1_81)");
    // if trimmed_rustc_version >= Version::new(1, 81, 0) {
    //     println!("cargo:rustc-cfg=rust_1_81");
    // }
}