@@ -95,7 +95,7 @@ fn alloc_notify_allocs() -> NotifyAllocs {
95
95
/// `ioctl(fd, request, ptr)` must be safe to call
96
96
unsafe fn ioctl < T > ( fd : RawFd , request : libc:: c_ulong , ptr : * mut T ) -> Option < ( ) > {
97
97
// SAFETY: By function contract
98
- if unsafe { libc:: ioctl ( fd, request, ptr) } == -1 {
98
+ if unsafe { libc:: ioctl ( fd, request as _ , ptr) } == -1 {
99
99
// SAFETY: Trivial
100
100
if unsafe { * __errno_location ( ) } == ENOENT {
101
101
None
@@ -192,7 +192,7 @@ fn receive_fd(rx_fd: UnixStream) -> RawFd {
192
192
// SAFETY: SingleRightAnciliaryData can be zero-initialized.
193
193
let mut control: SingleRightAnciliaryData = unsafe { zeroed ( ) } ;
194
194
// SAFETY: The buf field is valid when zero-initialized.
195
- msg. msg_controllen = unsafe { control. buf . len ( ) } ;
195
+ msg. msg_controllen = unsafe { control. buf . len ( ) as _ } ;
196
196
msg. msg_control = & mut control as * mut _ as * mut libc:: c_void ;
197
197
198
198
// SAFETY: A valid socket fd and a valid initialized msghdr are passed in.
@@ -208,7 +208,7 @@ fn receive_fd(rx_fd: UnixStream) -> RawFd {
208
208
unsafe {
209
209
let cmsgp = CMSG_FIRSTHDR ( & msg) ;
210
210
if cmsgp. is_null ( )
211
- || ( * cmsgp) . cmsg_len != CMSG_LEN ( size_of :: < c_int > ( ) as u32 ) as usize
211
+ || ( * cmsgp) . cmsg_len != CMSG_LEN ( size_of :: < c_int > ( ) as u32 ) as _
212
212
|| ( * cmsgp) . cmsg_level != SOL_SOCKET
213
213
|| ( * cmsgp) . cmsg_type != SCM_RIGHTS
214
214
{
@@ -235,15 +235,15 @@ fn send_fd(tx_fd: UnixStream, notify_fd: RawFd) -> io::Result<()> {
235
235
// SAFETY: SingleRightAnciliaryData can be zero-initialized.
236
236
let mut control: SingleRightAnciliaryData = unsafe { zeroed ( ) } ;
237
237
// SAFETY: The buf field is valid when zero-initialized.
238
- msg. msg_controllen = unsafe { control. buf . len ( ) } ;
238
+ msg. msg_controllen = unsafe { control. buf . len ( ) as _ } ;
239
239
msg. msg_control = & mut control as * mut _ as * mut _ ;
240
240
// SAFETY: msg.msg_control is correctly initialized and this follows
241
241
// the contract of the various CMSG_* macros.
242
242
unsafe {
243
243
let cmsgp = CMSG_FIRSTHDR ( & msg) ;
244
244
( * cmsgp) . cmsg_level = SOL_SOCKET ;
245
245
( * cmsgp) . cmsg_type = SCM_RIGHTS ;
246
- ( * cmsgp) . cmsg_len = CMSG_LEN ( size_of :: < c_int > ( ) as u32 ) as usize ;
246
+ ( * cmsgp) . cmsg_len = CMSG_LEN ( size_of :: < c_int > ( ) as u32 ) as _ ;
247
247
ptr:: write ( CMSG_DATA ( cmsgp) . cast :: < c_int > ( ) , notify_fd) ;
248
248
}
249
249
0 commit comments