Skip to content

Commit 12c2b35

Browse files
committed
Drop the ptr_addr_of conditional
This is possible since increasing the MSRV to 1.63 (apply <#4065> to `main`) (cherry picked from commit 85eac5f)
1 parent 094a24d commit 12c2b35

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/macros.rs

-6
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,3 @@ macro_rules! __item {
273273
$i
274274
};
275275
}
276-
277-
macro_rules! ptr_addr_of {
278-
($place:expr) => {
279-
::core::ptr::addr_of!($place)
280-
};
281-
}

src/wasi/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -382,16 +382,16 @@ cfg_if! {
382382
// unsafe code here is required in the stable, but not in nightly
383383
#[allow(unused_unsafe)]
384384
pub static CLOCK_MONOTONIC: clockid_t =
385-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
385+
clockid_t(core::ptr::addr_of!(_CLOCK_MONOTONIC));
386386
#[allow(unused_unsafe)]
387387
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
388-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
388+
clockid_t(core::ptr::addr_of!(_CLOCK_PROCESS_CPUTIME_ID));
389389
#[allow(unused_unsafe)]
390390
pub static CLOCK_REALTIME: clockid_t =
391-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
391+
clockid_t(core::ptr::addr_of!(_CLOCK_REALTIME));
392392
#[allow(unused_unsafe)]
393393
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
394-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
394+
clockid_t(core::ptr::addr_of!(_CLOCK_THREAD_CPUTIME_ID));
395395
}
396396
}
397397

0 commit comments

Comments
 (0)