@@ -14,8 +14,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1414 "freebsd13" ,
1515 "freebsd14" ,
1616 "freebsd15" ,
17- "libc_const_extern_fn" ,
18- "libc_const_extern_fn_unstable" ,
1917 "libc_deny_warnings" ,
2018 "libc_ctest" ,
2119] ;
@@ -39,11 +37,10 @@ fn main() {
3937 // Avoid unnecessary re-building.
4038 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
4139
42- let ( rustc_minor_ver, is_nightly ) = rustc_minor_nightly ( ) ;
40+ let ( rustc_minor_ver, _is_nightly ) = rustc_minor_nightly ( ) ;
4341 let rustc_dep_of_std = env:: var ( "CARGO_FEATURE_RUSTC_DEP_OF_STD" ) . is_ok ( ) ;
4442 let libc_ci = env:: var ( "LIBC_CI" ) . is_ok ( ) ;
4543 let libc_check_cfg = env:: var ( "LIBC_CHECK_CFG" ) . is_ok ( ) || rustc_minor_ver >= 80 ;
46- let const_extern_fn_cargo_feature = env:: var ( "CARGO_FEATURE_CONST_EXTERN_FN" ) . is_ok ( ) ;
4744
4845 // The ABI of libc used by std is backward compatible with FreeBSD 12.
4946 // The ABI of libc from crates.io is backward compatible with FreeBSD 11.
@@ -78,20 +75,6 @@ fn main() {
7875 set_cfg ( "libc_deny_warnings" ) ;
7976 }
8077
81- // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C".
82- if rustc_minor_ver >= 62 {
83- set_cfg ( "libc_const_extern_fn" ) ;
84- } else {
85- // Rust < 1.62.0 requires a crate feature and feature gate.
86- if const_extern_fn_cargo_feature {
87- if !is_nightly || rustc_minor_ver < 40 {
88- panic ! ( "const-extern-fn requires a nightly compiler >= 1.40" ) ;
89- }
90- set_cfg ( "libc_const_extern_fn_unstable" ) ;
91- set_cfg ( "libc_const_extern_fn" ) ;
92- }
93- }
94-
9578 // check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the
9679 // codebase. libc can configure it if the appropriate environment variable is passed. Since
9780 // rust-lang/rust enforces it, this is useful when using a custom libc fork there.
0 commit comments