Skip to content

Commit a49b077

Browse files
committed
Require rust >= 1.51 and drop libc_ptr_addr_of conditional
1 parent fa15d78 commit a49b077

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml"]
1414
description = """
1515
Raw FFI bindings to platform libraries like libc.
1616
"""
17-
rust-version = "1.40"
17+
rust-version = "1.51"
1818

1919
[package.metadata.docs.rs]
2020
features = ["const-extern-fn", "extra_traits"]

build.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ fn main() {
4242
println!("cargo:rustc-cfg=libc_deny_warnings");
4343
}
4444

45-
if rustc_minor_ver >= 51 || rustc_dep_of_std {
46-
println!("cargo:rustc-cfg=libc_ptr_addr_of");
47-
}
48-
4945
// #[thread_local] is currently unstable
5046
if rustc_dep_of_std {
5147
println!("cargo:rustc-cfg=libc_thread_local");

src/macros.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,3 @@ macro_rules! deprecated_mach {
305305
)*
306306
}
307307
}
308-
309-
#[cfg(not(libc_ptr_addr_of))]
310-
macro_rules! ptr_addr_of {
311-
($place:expr) => {
312-
&$place
313-
};
314-
}
315-
316-
#[cfg(libc_ptr_addr_of)]
317-
macro_rules! ptr_addr_of {
318-
($place:expr) => {
319-
::core::ptr::addr_of!($place)
320-
};
321-
}

src/wasi.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,13 @@ 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-
pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
365+
pub static CLOCK_MONOTONIC: clockid_t =
366+
unsafe { clockid_t(::core::ptr::addr_of!(_CLOCK_MONOTONIC)) };
366367
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
367-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
368-
pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
368+
unsafe { clockid_t(::core::ptr::addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
369+
pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(::core::ptr::addr_of!(_CLOCK_REALTIME)) };
369370
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
370-
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
371+
unsafe { clockid_t(::core::ptr::addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
371372

372373
pub const ABDAY_1: ::nl_item = 0x20000;
373374
pub const ABDAY_2: ::nl_item = 0x20001;

0 commit comments

Comments
 (0)