Skip to content

Commit 18dca72

Browse files
bjorn3tgross35
authored andcommitted
Avoid usage of thread_local on DragonFlyBSD
__error() has been deprecated and return the same value as __errno_location(). Removing the __error() function eliminates the sole use of thread_local in this crate. (backport <#3653>) (cherry picked from commit de76fee) [ resolved conflicts in all files and removed the now-unused `rustc_dep_of_std` - Trevor ]
1 parent 034e4f3 commit 18dca72

File tree

5 files changed

+0
-37
lines changed

5 files changed

+0
-37
lines changed

build.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const ALLOWED_CFGS: &[&str] = &[
1818
// Corresponds to `_TIME_BITS=64` in glibc
1919
"gnu_time_bits64",
2020
"libc_deny_warnings",
21-
"libc_thread_local",
2221
// Corresponds to `__USE_TIME_BITS64` in UAPI
2322
"linux_time_bits64",
2423
"musl_v1_2_3",
@@ -47,7 +46,6 @@ fn main() {
4746
println!("cargo:rerun-if-changed=build.rs");
4847

4948
let (rustc_minor_ver, _is_nightly) = rustc_minor_nightly();
50-
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
5149
let libc_ci = env::var("LIBC_CI").is_ok();
5250
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
5351
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
@@ -143,11 +141,6 @@ fn main() {
143141
set_cfg("libc_deny_warnings");
144142
}
145143

146-
// #[thread_local] is currently unstable
147-
if rustc_dep_of_std {
148-
set_cfg("libc_thread_local");
149-
}
150-
151144
// Since Rust 1.80, configuration that isn't recognized by default needs to be provided to
152145
// avoid warnings.
153146
if rustc_minor_ver >= 80 {

libc-test/build.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ fn do_ctest() {
7272
fn ctest_cfg() -> ctest::TestGenerator {
7373
let mut cfg = ctest::TestGenerator::new();
7474
cfg.skip_private(true);
75-
let libc_cfgs = ["libc_thread_local"];
76-
for f in &libc_cfgs {
77-
cfg.cfg(f, None);
78-
}
7975
cfg
8076
}
8177

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#![cfg_attr(libc_deny_warnings, deny(warnings))]
2727
// Attributes needed when building as part of the standard library
2828
#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, no_core))]
29-
#![cfg_attr(libc_thread_local, feature(thread_local))]
3029
#![cfg_attr(feature = "rustc-dep-of-std", allow(internal_features))]
3130
// DIFF(1.0): The thread local references that raise this lint were removed in 1.0
3231
#![cfg_attr(feature = "rustc-dep-of-std", allow(static_mut_refs))]

src/unix/bsd/freebsdlike/dragonfly/errno.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,11 +1625,3 @@ extern "C" {
16251625
entry: vm_map_entry_t,
16261626
) -> vm_map_entry_t;
16271627
}
1628-
1629-
// DIFF(main): module removed in de76fee6
1630-
cfg_if! {
1631-
if #[cfg(libc_thread_local)] {
1632-
mod errno;
1633-
pub use self::errno::*;
1634-
}
1635-
}

0 commit comments

Comments
 (0)