Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uu/date/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ fn set_system_datetime(date: Zoned) -> UResult<()> {
tv_nsec: ts.subsec_nanosecond() as _,
};

let result = unsafe { clock_settime(CLOCK_REALTIME, &timespec) };
let result = unsafe { clock_settime(CLOCK_REALTIME, &raw const timespec) };

if result == 0 {
Ok(())
Expand Down Expand Up @@ -492,7 +492,7 @@ fn set_system_datetime(date: Zoned) -> UResult<()> {
wMilliseconds: ((date.subsec_nanosecond() / 1_000_000) % 1000) as u16,
};

let result = unsafe { SetSystemTime(&system_time) };
let result = unsafe { SetSystemTime(&raw const system_time) };

if result == 0 {
Err(std::io::Error::last_os_error()
Expand Down
4 changes: 2 additions & 2 deletions src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ fn get_size_on_disk(path: &Path) -> u64 {

unsafe {
let mut file_info: FILE_STANDARD_INFO = core::mem::zeroed();
let file_info_ptr: *mut FILE_STANDARD_INFO = &mut file_info;
let file_info_ptr: *mut FILE_STANDARD_INFO = &raw mut file_info;

let success = GetFileInformationByHandleEx(
file.as_raw_handle() as HANDLE,
Expand All @@ -257,7 +257,7 @@ fn get_file_info(path: &Path) -> Option<FileInfo> {

unsafe {
let mut file_info: FILE_ID_INFO = core::mem::zeroed();
let file_info_ptr: *mut FILE_ID_INFO = &mut file_info;
let file_info_ptr: *mut FILE_ID_INFO = &raw mut file_info;

let success = GetFileInformationByHandleEx(
file.as_raw_handle() as HANDLE,
Expand Down
2 changes: 1 addition & 1 deletion src/uu/sort/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ fn get_rlimit() -> UResult<usize> {
rlim_cur: 0,
rlim_max: 0,
};
match unsafe { getrlimit(RLIMIT_NOFILE, &mut limit) } {
match unsafe { getrlimit(RLIMIT_NOFILE, &raw mut limit) } {
0 => Ok(limit.rlim_cur as usize),
_ => Err(UUsageError::new(2, get_message("sort-failed-fetch-rlimit"))),
}
Expand Down
2 changes: 1 addition & 1 deletion src/uu/whoami/src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn get_username() -> io::Result<OsString> {
let mut buffer = [0_u16; BUF_LEN as usize];
let mut len = BUF_LEN;
// SAFETY: buffer.len() == len
if unsafe { GetUserNameW(buffer.as_mut_ptr(), &mut len) } == 0 {
if unsafe { GetUserNameW(buffer.as_mut_ptr(), &raw mut len) } == 0 {
return Err(io::Error::last_os_error());
}
Ok(OsString::from_wide(&buffer[..len as usize - 1]))
Expand Down
10 changes: 8 additions & 2 deletions src/uucore/src/lib/features/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,14 @@ impl Passwd {
let name = CString::new(self.name.as_bytes()).unwrap();
loop {
ngroups_old = ngroups;
if unsafe { getgrouplist(name.as_ptr(), self.gid, groups.as_mut_ptr(), &mut ngroups) }
== -1
if unsafe {
getgrouplist(
name.as_ptr(),
self.gid,
groups.as_mut_ptr(),
&raw mut ngroups,
)
} == -1
{
if ngroups == ngroups_old {
ngroups *= 2;
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/fsext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ impl FsMeta for StatFs {
fn fsid(&self) -> u64 {
// Use type inference to determine the type of f_fsid
// (libc::__fsid_t on Android, libc::fsid_t on other platforms)
let f_fsid: &[u32; 2] = unsafe { &*(&self.f_fsid as *const _ as *const [u32; 2]) };
let f_fsid: &[u32; 2] = unsafe { &*(&raw const self.f_fsid as *const [u32; 2]) };
((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1])
}
#[cfg(not(any(
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ fn test_write_fast_fallthrough_uses_flush() {

#[test]
#[cfg(unix)]
#[ignore]
#[ignore = ""]
fn test_domain_socket() {
use std::io::prelude::*;
use std::os::unix::net::UnixListener;
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_cksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ mod gnu_cksum_c {
}

#[test]
#[ignore]
#[ignore = "todo"]
fn test_signed_checksums() {
todo!()
}
Expand Down
6 changes: 3 additions & 3 deletions tests/by-util/test_comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ fn zero_terminated_with_total() {
}
}

#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
#[cfg_attr(not(feature = "test_unimplemented"), ignore = "")]
#[test]
fn check_order() {
let scene = TestScenario::new(util_name!());
Expand All @@ -324,7 +324,7 @@ fn check_order() {
.stderr_is("error to be defined");
}

#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
#[cfg_attr(not(feature = "test_unimplemented"), ignore = "")]
#[test]
fn nocheck_order() {
let scene = TestScenario::new(util_name!());
Expand All @@ -340,7 +340,7 @@ fn nocheck_order() {
// when neither --check-order nor --no-check-order is provided,
// stderr and the error code behaves like check order, but stdout
// behaves like nocheck_order. However with some quirks detailed below.
#[cfg_attr(not(feature = "test_unimplemented"), ignore)]
#[cfg_attr(not(feature = "test_unimplemented"), ignore = "")]
#[test]
fn defaultcheck_order() {
let scene = TestScenario::new(util_name!());
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_dd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ fn test_null_fullblock() {
}

#[cfg(unix)]
#[ignore] // See note below before using this test.
#[ignore = "See note below before using this test."]
#[test]
fn test_fullblock() {
let tname = "fullblock-from-urand";
Expand Down Expand Up @@ -555,7 +555,7 @@ fn test_ascii_521k_to_file() {
);
}

#[ignore]
#[ignore = ""]
#[cfg(unix)]
#[test]
fn test_ascii_5_gibi_to_file() {
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ fn test_ls_long_ctime() {
}

#[test]
#[ignore]
#[ignore = ""]
fn test_ls_order_birthtime() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ fn test_parse_out_of_bounds_exponents() {
.stdout_only("-0\n1\n");
}

#[ignore]
#[ignore = ""]
#[test]
fn test_parse_valid_hexadecimal_float_format_issues() {
// These tests detect differences in the representation of floating-point values with GNU seq.
Expand Down
2 changes: 1 addition & 1 deletion tests/by-util/test_tail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4888,7 +4888,7 @@ fn test_following_with_pid() {
// should fail with any command that takes piped input.
// See also https://github.com/uutils/coreutils/issues/3895
#[test]
#[cfg_attr(not(feature = "expensive_tests"), ignore)]
#[cfg_attr(not(feature = "expensive_tests"), ignore = "")]
fn test_when_piped_input_then_no_broken_pipe() {
let ts = TestScenario::new("tail");
for i in 0..10000 {
Expand Down
Loading