Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d7aa7cf

Browse files
committedJul 15, 2024
Auto merge of rust-lang#127732 - GrigorenkoPV:teeos-safe-sys-init, r=Amanieu
sys::init is not unsafe on teeos https://github.com/rust-lang/rust/blob/88fa119c77682e6d55ce21001cf761675cfebeae/library/std/src/sys/pal/teeos/mod.rs#L40-L42 r​? `@petrochenkov`
2 parents 3492a6b + 0873299 commit d7aa7cf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎std/src/rt.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ macro_rules! rtunwrap {
9090
// `compiler/rustc_session/src/config/sigpipe.rs`.
9191
#[cfg_attr(test, allow(dead_code))]
9292
unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
93+
#[cfg_attr(target_os = "teeos", allow(unused_unsafe))]
9394
unsafe {
94-
sys::init(argc, argv, sigpipe);
95+
sys::init(argc, argv, sigpipe)
96+
};
9597

96-
// Set up the current thread to give it the right name.
97-
let thread = Thread::new_main();
98-
thread::set_current(thread);
99-
}
98+
// Set up the current thread to give it the right name.
99+
let thread = Thread::new_main();
100+
thread::set_current(thread);
100101
}
101102

102103
// One-time runtime cleanup.

0 commit comments

Comments
 (0)
Failed to load comments.