Skip to content

Commit 1b092dc

Browse files
committed
addr_of!(EXTERN_STATIC) is now considered safe
See rust-lang/rust#125834
1 parent f16089a commit 1b092dc

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
@@ -366,10 +366,14 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
366366
pub const _SC_IOV_MAX: c_int = 60;
367367
pub const _SC_SYMLOOP_MAX: c_int = 173;
368368

369+
#[allow(unused_unsafe)] // `addr_of!(EXTERN_STATIC)` is now considered safe
369370
pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
371+
#[allow(unused_unsafe)]
370372
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
371373
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
374+
#[allow(unused_unsafe)]
372375
pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
376+
#[allow(unused_unsafe)]
373377
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
374378
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
375379

0 commit comments

Comments
 (0)