Skip to content

Commit 4e83dec

Browse files
joboetmyl7
authored andcommitted
addr_of!(EXTERN_STATIC) is now considered safe
See rust-lang/rust#125834
1 parent dd4a81a commit 4e83dec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wasi.rs

+4
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,14 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
362362
pub const _SC_IOV_MAX: c_int = 60;
363363
pub const _SC_SYMLOOP_MAX: c_int = 173;
364364

365+
#[allow(unused_unsafe)] // `addr_of!(EXTERN_STATIC)` is now considered safe
365366
pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
367+
#[allow(unused_unsafe)]
366368
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
367369
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
370+
#[allow(unused_unsafe)]
368371
pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
372+
#[allow(unused_unsafe)]
369373
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
370374
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
371375

0 commit comments

Comments
 (0)