Skip to content

Commit 85eac5f

Browse files
committed
Drop the ptr_addr_of conditional
This is possible since increasing the MSRV to 1.63
1 parent de29a3f commit 85eac5f

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

build.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1818
"libc_const_extern_fn_unstable",
1919
"libc_deny_warnings",
2020
"libc_long_array",
21-
"libc_ptr_addr_of",
2221
"libc_thread_local",
2322
"libc_underscore_const_names",
2423
"libc_ctest",
@@ -87,10 +86,6 @@ fn main() {
8786
set_cfg("libc_long_array");
8887
}
8988

90-
if rustc_minor_ver >= 51 || rustc_dep_of_std {
91-
set_cfg("libc_ptr_addr_of");
92-
}
93-
9489
// Rust >= 1.37.0 allows underscores as anonymous constant names.
9590
if rustc_minor_ver >= 37 || rustc_dep_of_std {
9691
set_cfg("libc_underscore_const_names");

src/macros.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,17 +311,3 @@ macro_rules! deprecated_mach {
311311
)*
312312
}
313313
}
314-
315-
#[cfg(not(libc_ptr_addr_of))]
316-
macro_rules! ptr_addr_of {
317-
($place:expr) => {
318-
&$place
319-
};
320-
}
321-
322-
#[cfg(libc_ptr_addr_of)]
323-
macro_rules! ptr_addr_of {
324-
($place:expr) => {
325-
::core::ptr::addr_of!($place)
326-
};
327-
}

src/wasi/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,16 @@ cfg_if! {
380380
// `addr_of!(EXTERN_STATIC)` is now safe; remove `unsafe` when MSRV >= 1.82
381381
#[allow(unused_unsafe)]
382382
pub static CLOCK_MONOTONIC: clockid_t =
383-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
383+
clockid_t(core::ptr::addr_of!(_CLOCK_MONOTONIC));
384384
#[allow(unused_unsafe)]
385385
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
386-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
386+
clockid_t(core::ptr::addr_of!(_CLOCK_PROCESS_CPUTIME_ID));
387387
#[allow(unused_unsafe)]
388388
pub static CLOCK_REALTIME: clockid_t =
389-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
389+
clockid_t(core::ptr::addr_of!(_CLOCK_REALTIME));
390390
#[allow(unused_unsafe)]
391391
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
392-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
392+
clockid_t(core::ptr::addr_of!(_CLOCK_THREAD_CPUTIME_ID));
393393
}
394394
}
395395

0 commit comments

Comments
 (0)