Rollup merge of #138034 - thaliaarchi:use-prelude-size-of, r=tgross35
library: Use `size_of` from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them.
These functions were added to all preludes in Rust 1.80.
try-job: test-various
try-job: x86_64-gnu
try-job: x86_64-msvc-1
This commit is contained in:
@@ -814,7 +814,7 @@ impl Command {
|
||||
|
||||
let fds: [c_int; 1] = [pidfd as RawFd];
|
||||
|
||||
const SCM_MSG_LEN: usize = mem::size_of::<[c_int; 1]>();
|
||||
const SCM_MSG_LEN: usize = size_of::<[c_int; 1]>();
|
||||
|
||||
#[repr(C)]
|
||||
union Cmsg {
|
||||
@@ -833,7 +833,7 @@ impl Command {
|
||||
|
||||
// only attach cmsg if we successfully acquired the pidfd
|
||||
if pidfd >= 0 {
|
||||
msg.msg_controllen = mem::size_of_val(&cmsg.buf) as _;
|
||||
msg.msg_controllen = size_of_val(&cmsg.buf) as _;
|
||||
msg.msg_control = (&raw mut cmsg.buf) as *mut _;
|
||||
|
||||
let hdr = CMSG_FIRSTHDR((&raw mut msg) as *mut _);
|
||||
@@ -865,7 +865,7 @@ impl Command {
|
||||
use crate::sys::cvt_r;
|
||||
|
||||
unsafe {
|
||||
const SCM_MSG_LEN: usize = mem::size_of::<[c_int; 1]>();
|
||||
const SCM_MSG_LEN: usize = size_of::<[c_int; 1]>();
|
||||
|
||||
#[repr(C)]
|
||||
union Cmsg {
|
||||
@@ -880,7 +880,7 @@ impl Command {
|
||||
|
||||
msg.msg_iov = (&raw mut iov) as *mut _;
|
||||
msg.msg_iovlen = 1;
|
||||
msg.msg_controllen = mem::size_of::<Cmsg>() as _;
|
||||
msg.msg_controllen = size_of::<Cmsg>() as _;
|
||||
msg.msg_control = (&raw mut cmsg) as *mut _;
|
||||
|
||||
match cvt_r(|| libc::recvmsg(sock.as_raw(), &mut msg, libc::MSG_CMSG_CLOEXEC)) {
|
||||
|
||||
Reference in New Issue
Block a user