Skip to content

Commit

Permalink
Drop the ptr_addr_of conditional
Browse files Browse the repository at this point in the history
This is possible since increasing the MSRV to 1.63

(apply <#4065> to `main`)
(cherry picked from commit 85eac5f)
  • Loading branch information
tgross35 committed Nov 17, 2024
1 parent 094a24d commit 12c2b35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,3 @@ macro_rules! __item {
$i
};
}

macro_rules! ptr_addr_of {
($place:expr) => {
::core::ptr::addr_of!($place)
};
}
8 changes: 4 additions & 4 deletions src/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,16 @@ cfg_if! {
// unsafe code here is required in the stable, but not in nightly
#[allow(unused_unsafe)]
pub static CLOCK_MONOTONIC: clockid_t =
unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
clockid_t(core::ptr::addr_of!(_CLOCK_MONOTONIC));
#[allow(unused_unsafe)]
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
clockid_t(core::ptr::addr_of!(_CLOCK_PROCESS_CPUTIME_ID));
#[allow(unused_unsafe)]
pub static CLOCK_REALTIME: clockid_t =
unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
clockid_t(core::ptr::addr_of!(_CLOCK_REALTIME));
#[allow(unused_unsafe)]
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
clockid_t(core::ptr::addr_of!(_CLOCK_THREAD_CPUTIME_ID));
}
}

Expand Down

0 comments on commit 12c2b35

Please sign in to comment.