#![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");
}
}