about summary refs log tree commit diff
path: root/library/std/src/sys_common/once/queue.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-02-11 19:04:29 +0100
committerRalf Jung <post@ralfj.de>2024-02-21 20:15:52 +0100
commitb58f647d5488dce73bba517907c44af2c2a618c4 (patch)
tree24e9b1e2a3299ccd459c5e00db09c64220d6ba21 /library/std/src/sys_common/once/queue.rs
parent1d447a9946effc38c4b964a888ab408a3df3c246 (diff)
downloadrust-b58f647d5488dce73bba517907c44af2c2a618c4.tar.gz
rust-b58f647d5488dce73bba517907c44af2c2a618c4.zip
rename ptr::invalid -> ptr::without_provenance
also introduce ptr::dangling matching NonNull::dangling
Diffstat (limited to 'library/std/src/sys_common/once/queue.rs')
-rw-r--r--library/std/src/sys_common/once/queue.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/std/src/sys_common/once/queue.rs b/library/std/src/sys_common/once/queue.rs
index def0bcd6fac..3cc1df113e3 100644
--- a/library/std/src/sys_common/once/queue.rs
+++ b/library/std/src/sys_common/once/queue.rs
@@ -110,7 +110,7 @@ impl Once {
     #[inline]
     #[rustc_const_stable(feature = "const_once_new", since = "1.32.0")]
     pub const fn new() -> Once {
-        Once { state_and_queue: AtomicPtr::new(ptr::invalid_mut(INCOMPLETE)) }
+        Once { state_and_queue: AtomicPtr::new(ptr::without_provenance_mut(INCOMPLETE)) }
     }
 
     #[inline]
@@ -158,7 +158,7 @@ impl Once {
                     // Try to register this thread as the one RUNNING.
                     let exchange_result = self.state_and_queue.compare_exchange(
                         state_and_queue,
-                        ptr::invalid_mut(RUNNING),
+                        ptr::without_provenance_mut(RUNNING),
                         Ordering::Acquire,
                         Ordering::Acquire,
                     );
@@ -170,14 +170,14 @@ impl Once {
                     // wake them up on drop.
                     let mut waiter_queue = WaiterQueue {
                         state_and_queue: &self.state_and_queue,
-                        set_state_on_drop_to: ptr::invalid_mut(POISONED),
+                        set_state_on_drop_to: ptr::without_provenance_mut(POISONED),
                     };
                     // Run the initialization function, letting it know if we're
                     // poisoned or not.
                     let init_state = public::OnceState {
                         inner: OnceState {
                             poisoned: state_and_queue.addr() == POISONED,
-                            set_state_on_drop_to: Cell::new(ptr::invalid_mut(COMPLETE)),
+                            set_state_on_drop_to: Cell::new(ptr::without_provenance_mut(COMPLETE)),
                         },
                     };
                     init(&init_state);
@@ -289,6 +289,6 @@ impl OnceState {
 
     #[inline]
     pub fn poison(&self) {
-        self.set_state_on_drop_to.set(ptr::invalid_mut(POISONED));
+        self.set_state_on_drop_to.set(ptr::without_provenance_mut(POISONED));
     }
 }