about summary refs log tree commit diff
path: root/library/std/src/os/unix/net/stream.rs
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2024-09-25 17:03:20 -0700
committerJosh Stone <jistone@redhat.com>2024-09-25 17:03:20 -0700
commitf4d9d1a0eaf7e5de8c368ac5af500adf9e06f6e7 (patch)
treecdbf361d03ade9c8d77b5ed2618c5862c2c84f20 /library/std/src/os/unix/net/stream.rs
parent0399709cdc3c5cc22327e9f657dc7956546a0457 (diff)
downloadrust-f4d9d1a0eaf7e5de8c368ac5af500adf9e06f6e7.tar.gz
rust-f4d9d1a0eaf7e5de8c368ac5af500adf9e06f6e7.zip
Use `&raw` in the standard library
Since the stabilization in #127679 has reached stage0, 1.82-beta, we can
start using `&raw` freely, and even the soft-deprecated `ptr::addr_of!`
and `ptr::addr_of_mut!` can stop allowing the unstable feature.

I intentionally did not change any documentation or tests, but the rest
of those macro uses are all now using `&raw const` or `&raw mut` in the
standard library.
Diffstat (limited to 'library/std/src/os/unix/net/stream.rs')
-rw-r--r--library/std/src/os/unix/net/stream.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/os/unix/net/stream.rs b/library/std/src/os/unix/net/stream.rs
index 4967c5b89ec..cb210b41eae 100644
--- a/library/std/src/os/unix/net/stream.rs
+++ b/library/std/src/os/unix/net/stream.rs
@@ -84,7 +84,7 @@ impl UnixStream {
             let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?;
             let (addr, len) = sockaddr_un(path.as_ref())?;
 
-            cvt(libc::connect(inner.as_raw_fd(), core::ptr::addr_of!(addr) as *const _, len))?;
+            cvt(libc::connect(inner.as_raw_fd(), (&raw const addr) as *const _, len))?;
             Ok(UnixStream(inner))
         }
     }
@@ -118,7 +118,7 @@ impl UnixStream {
             let inner = Socket::new_raw(libc::AF_UNIX, libc::SOCK_STREAM)?;
             cvt(libc::connect(
                 inner.as_raw_fd(),
-                core::ptr::addr_of!(socket_addr.addr) as *const _,
+                (&raw const socket_addr.addr) as *const _,
                 socket_addr.len,
             ))?;
             Ok(UnixStream(inner))