Merge branch 'borrow-as-ptr' into 'master'

enforce borrow-as-ptr clippy lint

See merge request redox-os/relibc!1060
This commit is contained in:
Jeremy Soller
2026-03-01 13:18:31 -07:00
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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()) }
+1 -1
View File
@@ -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)
}
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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) };
}