diff --git a/Cargo.toml b/Cargo.toml index 596aacd369..a4d00608e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ members = [ exclude = ["tests", "dlmalloc-rs"] [workspace.lints.clippy] -borrow_as_ptr = "warn" # TODO review occurrences +borrow_as_ptr = "deny" cast_lossless = "warn" # TODO review occurrences cast_ptr_alignment = "allow" # TODO review occurrences missing_safety_doc = "allow" # TODO review occurrences diff --git a/src/header/arpa_inet/mod.rs b/src/header/arpa_inet/mod.rs index 4a52ab15c9..7884f408a5 100644 --- a/src/header/arpa_inet/mod.rs +++ b/src/header/arpa_inet/mod.rs @@ -31,7 +31,7 @@ use crate::{ pub unsafe extern "C" fn inet_addr(cp: *const c_char) -> in_addr_t { let mut val: in_addr = in_addr { s_addr: 0 }; - if unsafe { inet_aton(cp, &mut val) } > 0 { + if unsafe { inet_aton(cp, &raw mut val) } > 0 { val.s_addr } else { INADDR_NONE diff --git a/src/header/grp/mod.rs b/src/header/grp/mod.rs index 04a8679073..7734ee4362 100644 --- a/src/header/grp/mod.rs +++ b/src/header/grp/mod.rs @@ -541,7 +541,7 @@ pub unsafe extern "C" fn getgrouplist( pub unsafe extern "C" fn initgroups(user: *const c_char, gid: gid_t) -> c_int { let mut groups = [0; limits::NGROUPS_MAX]; let mut count = groups.len() as c_int; - if unsafe { getgrouplist(user, gid, groups.as_mut_ptr(), &mut count) < 0 } { + if unsafe { getgrouplist(user, gid, groups.as_mut_ptr(), &raw mut count) < 0 } { return -1; } unsafe { unistd::setgroups(count as size_t, groups.as_ptr()) } diff --git a/src/header/netdb/mod.rs b/src/header/netdb/mod.rs index f0a0366566..8b11c28e0b 100644 --- a/src/header/netdb/mod.rs +++ b/src/header/netdb/mod.rs @@ -944,7 +944,7 @@ pub unsafe extern "C" fn getaddrinfo( unsafe { let mut indirect = res; while !(*indirect).is_null() { - indirect = &mut (**indirect).ai_next; + indirect = &raw mut (**indirect).ai_next; } *indirect = Box::into_raw(addrinfo) } diff --git a/src/header/poll/mod.rs b/src/header/poll/mod.rs index 72edb26701..a01bb2d73b 100644 --- a/src/header/poll/mod.rs +++ b/src/header/poll/mod.rs @@ -88,7 +88,7 @@ pub unsafe fn poll_epoll(fds: &mut [pollfd], timeout: c_int, sigmask: *const sig } } - if unsafe { epoll_ctl(*ep, EPOLL_CTL_ADD, pfd.fd, &mut event) } < 0 { + if unsafe { epoll_ctl(*ep, EPOLL_CTL_ADD, pfd.fd, &raw mut event) } < 0 { if platform::ERRNO.get() == EBADF { pfd.revents |= POLLNVAL; closed += 1; diff --git a/src/start.rs b/src/start.rs index 5c1c4854bc..b0e4b06af9 100644 --- a/src/start.rs +++ b/src/start.rs @@ -236,7 +236,7 @@ pub unsafe extern "C" fn relibc_start_v1( { let mut f = unsafe { &__preinit_array_start } as *const _; #[allow(clippy::op_ref)] - while f < unsafe { &__preinit_array_end } { + while f < &raw const __preinit_array_end { (unsafe { *f })(); f = unsafe { f.offset(1) }; } @@ -252,7 +252,7 @@ pub unsafe extern "C" fn relibc_start_v1( { let mut f = unsafe { &__init_array_start } as *const _; #[allow(clippy::op_ref)] - while f < unsafe { &__init_array_end } { + while f < &raw const __init_array_end { (unsafe { *f })(); f = unsafe { f.offset(1) }; }