Skip to content

Commit ca0f659

Browse files
committed
Move exit guard from sys::common::exit_guard to sys::exit_guard.
1 parent cf300a7 commit ca0f659

File tree

5 files changed

+3
-4
lines changed

5 files changed

+3
-4
lines changed

Diff for: std/src/rt.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ fn lang_start_internal(
146146
panic::catch_unwind(cleanup).map_err(rt_abort)?;
147147
// Guard against multple threads calling `libc::exit` concurrently.
148148
// See the documentation for `unique_thread_exit` for more information.
149-
panic::catch_unwind(|| crate::sys::common::exit_guard::unique_thread_exit())
150-
.map_err(rt_abort)?;
149+
panic::catch_unwind(|| crate::sys::exit_guard::unique_thread_exit()).map_err(rt_abort)?;
151150
ret_code
152151
}
153152

File renamed without changes.

Diff for: std/src/sys/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/// descriptors.
44
mod pal;
55

6+
pub(crate) mod exit_guard;
67
mod personality;
78

89
pub mod backtrace;

Diff for: std/src/sys/pal/common/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![allow(dead_code)]
1212

1313
pub mod alloc;
14-
pub mod exit_guard;
1514
pub mod small_c_string;
1615

1716
#[cfg(test)]

Diff for: std/src/sys/pal/unix/os.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ pub fn home_dir() -> Option<PathBuf> {
758758
}
759759

760760
pub fn exit(code: i32) -> ! {
761-
crate::sys::common::exit_guard::unique_thread_exit();
761+
crate::sys::exit_guard::unique_thread_exit();
762762
unsafe { libc::exit(code as c_int) }
763763
}
764764

0 commit comments

Comments
 (0)