@@ -14,8 +14,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
14
14
"freebsd13" ,
15
15
"freebsd14" ,
16
16
"freebsd15" ,
17
- "libc_const_extern_fn" ,
18
- "libc_const_extern_fn_unstable" ,
19
17
"libc_deny_warnings" ,
20
18
"libc_ctest" ,
21
19
] ;
@@ -39,11 +37,10 @@ fn main() {
39
37
// Avoid unnecessary re-building.
40
38
println ! ( "cargo:rerun-if-changed=build.rs" ) ;
41
39
42
- let ( rustc_minor_ver, is_nightly ) = rustc_minor_nightly ( ) ;
40
+ let ( rustc_minor_ver, _is_nightly ) = rustc_minor_nightly ( ) ;
43
41
let rustc_dep_of_std = env:: var ( "CARGO_FEATURE_RUSTC_DEP_OF_STD" ) . is_ok ( ) ;
44
42
let libc_ci = env:: var ( "LIBC_CI" ) . is_ok ( ) ;
45
43
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 ( ) ;
47
44
48
45
// The ABI of libc used by std is backward compatible with FreeBSD 12.
49
46
// The ABI of libc from crates.io is backward compatible with FreeBSD 11.
@@ -78,20 +75,6 @@ fn main() {
78
75
set_cfg ( "libc_deny_warnings" ) ;
79
76
}
80
77
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
-
95
78
// check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the
96
79
// codebase. libc can configure it if the appropriate environment variable is passed. Since
97
80
// rust-lang/rust enforces it, this is useful when using a custom libc fork there.
0 commit comments