foreign 0.4.0

Conversion between foreign and Rust types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![doc = include_str!("README.md")]

use rustc_version::version_meta;

fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    println!("cargo:rustc-check-cfg=cfg(has_diagnostic_namespace)");

    // #[diagnostic::on_unimplemented] needs Rust 1.78.  Below that the
    // `diagnostic` tool namespace does not exist at all, so the attribute
    // is a hard error rather than something the compiler can ignore.
    let v = version_meta()
        .expect("cannot determine rustc version")
        .semver;
    if (v.major, v.minor) >= (1, 78) {
        println!("cargo:rustc-cfg=has_diagnostic_namespace");
    }
}