diff options
| author | Josh Stone <jistone@redhat.com> | 2024-09-25 17:03:20 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2024-09-25 17:03:20 -0700 |
| commit | f4d9d1a0eaf7e5de8c368ac5af500adf9e06f6e7 (patch) | |
| tree | cdbf361d03ade9c8d77b5ed2618c5862c2c84f20 /library/std/src/sync/mpmc | |
| parent | 0399709cdc3c5cc22327e9f657dc7956546a0457 (diff) | |
| download | rust-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/sync/mpmc')
| -rw-r--r-- | library/std/src/sync/mpmc/zero.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/library/std/src/sync/mpmc/zero.rs b/library/std/src/sync/mpmc/zero.rs index 2451d7b79d1..446881291e6 100644 --- a/library/std/src/sync/mpmc/zero.rs +++ b/library/std/src/sync/mpmc/zero.rs @@ -185,11 +185,7 @@ impl<T> Channel<T> { // Prepare for blocking until a receiver wakes us up. let oper = Operation::hook(token); let mut packet = Packet::<T>::message_on_stack(msg); - inner.senders.register_with_packet( - oper, - core::ptr::addr_of_mut!(packet) as *mut (), - cx, - ); + inner.senders.register_with_packet(oper, (&raw mut packet) as *mut (), cx); inner.receivers.notify(); drop(inner); @@ -256,11 +252,7 @@ impl<T> Channel<T> { // Prepare for blocking until a sender wakes us up. let oper = Operation::hook(token); let mut packet = Packet::<T>::empty_on_stack(); - inner.receivers.register_with_packet( - oper, - core::ptr::addr_of_mut!(packet) as *mut (), - cx, - ); + inner.receivers.register_with_packet(oper, (&raw mut packet) as *mut (), cx); inner.senders.notify(); drop(inner); |
