diff options
| author | Pavel Grigorenko <grigorenkopv@ya.ru> | 2024-02-24 16:02:17 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <grigorenkopv@ya.ru> | 2024-02-24 16:02:17 +0300 |
| commit | ff187a92d84f352670a9a63e8519eac114456d38 (patch) | |
| tree | bb16e4e323011af089b5e934ca5a765216567047 /library/std/src/sys_common/once/queue.rs | |
| parent | 8f359beca4e58bc3ae795a666301a8f47023044c (diff) | |
| download | rust-ff187a92d84f352670a9a63e8519eac114456d38.tar.gz rust-ff187a92d84f352670a9a63e8519eac114456d38.zip | |
library: use `addr_of!`
Diffstat (limited to 'library/std/src/sys_common/once/queue.rs')
| -rw-r--r-- | library/std/src/sys_common/once/queue.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys_common/once/queue.rs b/library/std/src/sys_common/once/queue.rs index 3cc1df113e3..730cdb768bd 100644 --- a/library/std/src/sys_common/once/queue.rs +++ b/library/std/src/sys_common/once/queue.rs @@ -212,7 +212,7 @@ fn wait(state_and_queue: &AtomicPtr<Masked>, mut current_state: *mut Masked) { signaled: AtomicBool::new(false), next: current_state.with_addr(current_state.addr() & !STATE_MASK) as *const Waiter, }; - let me = &node as *const Waiter as *const Masked as *mut Masked; + let me = core::ptr::addr_of!(node) as *const Masked as *mut Masked; // Try to slide in the node at the head of the linked list, making sure // that another thread didn't just replace the head of the linked list. |
