about summary refs log tree commit diff
path: root/library/std/src/sys/pal/unix/thread.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-26 08:12:02 +0000
committerbors <bors@rust-lang.org>2024-09-26 08:12:02 +0000
commitf2becdff0496003217e7fc6fbfcaf2640e162775 (patch)
tree8fd53c6239adce92e37e8fcafe2dd75d06d535ca /library/std/src/sys/pal/unix/thread.rs
parent76ed7a1fa40c3f54d3fd3f834e12bf9c932d0146 (diff)
parentf4d9d1a0eaf7e5de8c368ac5af500adf9e06f6e7 (diff)
downloadrust-f2becdff0496003217e7fc6fbfcaf2640e162775.tar.gz
rust-f2becdff0496003217e7fc6fbfcaf2640e162775.zip
Auto merge of #130865 - cuviper:library-raw_ref_op, r=tgross35
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/sys/pal/unix/thread.rs')
-rw-r--r--library/std/src/sys/pal/unix/thread.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs
index cb6133274d9..2f2d6e6add3 100644
--- a/library/std/src/sys/pal/unix/thread.rs
+++ b/library/std/src/sys/pal/unix/thread.rs
@@ -258,7 +258,7 @@ impl Thread {
                     tv_nsec: nsecs,
                 };
                 secs -= ts.tv_sec as u64;
-                let ts_ptr = core::ptr::addr_of_mut!(ts);
+                let ts_ptr = &raw mut ts;
                 if libc::nanosleep(ts_ptr, ts_ptr) == -1 {
                     assert_eq!(os::errno(), libc::EINTR);
                     secs += ts.tv_sec as u64;
@@ -447,8 +447,8 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
                     libc::sysctl(
                         mib.as_mut_ptr(),
                         2,
-                        core::ptr::addr_of_mut!(cpus) as *mut _,
-                        core::ptr::addr_of_mut!(cpus_size) as *mut _,
+                        (&raw mut cpus) as *mut _,
+                        (&raw mut cpus_size) as *mut _,
                         ptr::null_mut(),
                         0,
                     )