Skip to content

Commit 17bbd1e

Browse files
authored
Merge pull request #363 from dtolnay/checkcfg
Resolve unexpected_cfgs warning
2 parents 8e62244 + 3ab3c3b commit 17bbd1e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ fn main() {
6565
None => return,
6666
};
6767

68+
if rustc >= 80 {
69+
println!("cargo:rustc-check-cfg=cfg(anyhow_nightly_testing)");
70+
println!("cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str)");
71+
println!("cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of)");
72+
println!("cargo:rustc-check-cfg=cfg(anyhow_no_unsafe_op_in_unsafe_fn_lint)");
73+
println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
74+
println!("cargo:rustc-check-cfg=cfg(error_generic_member_access)");
75+
println!("cargo:rustc-check-cfg=cfg(std_backtrace)");
76+
}
77+
6878
if rustc < 51 {
6979
// core::ptr::addr_of
7080
// https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#stabilized-apis

0 commit comments

Comments
 (0)