diff --git a/build.rs b/build.rs index 2e871ae..0d757e1 100644 --- a/build.rs +++ b/build.rs @@ -65,6 +65,16 @@ fn main() { None => return, }; + if rustc >= 80 { + println!("cargo:rustc-check-cfg=cfg(anyhow_nightly_testing)"); + println!("cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str)"); + println!("cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of)"); + println!("cargo:rustc-check-cfg=cfg(anyhow_no_unsafe_op_in_unsafe_fn_lint)"); + println!("cargo:rustc-check-cfg=cfg(doc_cfg)"); + println!("cargo:rustc-check-cfg=cfg(error_generic_member_access)"); + println!("cargo:rustc-check-cfg=cfg(std_backtrace)"); + } + if rustc < 51 { // core::ptr::addr_of // https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#stabilized-apis