diff --git a/std/src/rt.rs b/std/src/rt.rs index 8a6f3fe291a75..c0a1c5f5594ae 100644 --- a/std/src/rt.rs +++ b/std/src/rt.rs @@ -146,8 +146,7 @@ fn lang_start_internal( panic::catch_unwind(cleanup).map_err(rt_abort)?; // Guard against multple threads calling `libc::exit` concurrently. // See the documentation for `unique_thread_exit` for more information. - panic::catch_unwind(|| crate::sys::common::exit_guard::unique_thread_exit()) - .map_err(rt_abort)?; + panic::catch_unwind(|| crate::sys::exit_guard::unique_thread_exit()).map_err(rt_abort)?; ret_code } diff --git a/std/src/sys/pal/common/exit_guard.rs b/std/src/sys/exit_guard.rs similarity index 100% rename from std/src/sys/pal/common/exit_guard.rs rename to std/src/sys/exit_guard.rs diff --git a/std/src/sys/mod.rs b/std/src/sys/mod.rs index 8aa35c40fe052..22ebc979bf7e4 100644 --- a/std/src/sys/mod.rs +++ b/std/src/sys/mod.rs @@ -3,6 +3,7 @@ /// descriptors. mod pal; +pub(crate) mod exit_guard; mod personality; pub mod backtrace; diff --git a/std/src/sys/pal/common/mod.rs b/std/src/sys/pal/common/mod.rs index cc1dceb63e2f5..29fc0835d7666 100644 --- a/std/src/sys/pal/common/mod.rs +++ b/std/src/sys/pal/common/mod.rs @@ -11,7 +11,6 @@ #![allow(dead_code)] pub mod alloc; -pub mod exit_guard; pub mod small_c_string; #[cfg(test)] diff --git a/std/src/sys/pal/unix/os.rs b/std/src/sys/pal/unix/os.rs index 3f598a095c156..397a0debe58c3 100644 --- a/std/src/sys/pal/unix/os.rs +++ b/std/src/sys/pal/unix/os.rs @@ -758,7 +758,7 @@ pub fn home_dir() -> Option { } pub fn exit(code: i32) -> ! { - crate::sys::common::exit_guard::unique_thread_exit(); + crate::sys::exit_guard::unique_thread_exit(); unsafe { libc::exit(code as c_int) } }