Skip to content

Commit

Permalink
Merge pull request #363 from dtolnay/checkcfg
Browse files Browse the repository at this point in the history
Resolve unexpected_cfgs warning
  • Loading branch information
dtolnay committed May 6, 2024
2 parents 8e62244 + 3ab3c3b commit 17bbd1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build.rs
Expand Up @@ -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
Expand Down

0 comments on commit 17bbd1e

Please sign in to comment.