()
| 1022 | /// `this` must be a pointer produced by `Arc::into_raw` on an `Arc<Self>`. |
| 1023 | /// |
| 1024 | /// This call takes ownership of exactly one strong reference count for that |
| 1025 | /// allocation, releasing it via `Arc::decrement_strong_count` internally. |
| 1026 | /// The caller must hold "ownership" of one such strong reference. |
| 1027 | unsafe fn drop_as_waker(this: *const ()) { |
| 1028 | // Rather than converting back into an arc, we can just decrement the |
| 1029 | // counter here. |
| 1030 | // |
| 1031 | // SAFETY: `this` came from `Arc::into_raw` and the caller transfers |
| 1032 | // ownership of one strong count (per the contract), so decrementing it |
| 1033 | // is sound. |
| 1034 | unsafe { Arc::decrement_strong_count(this.cast::<Self>()) }; |
| 1035 | } |
| 1036 | } |
| 1037 | |
| 1038 | // ----------------------------------------------------------------------------- |
| 1039 | // Scope pointer |
| 1040 | |
| 1041 | mod scope_ptr { |
| 1042 | //! Defines a "lifetime-erased" reference-counting pointer to a scope. |
| 1043 | |
| 1044 | use alloc::boxed::Box; |
| 1045 | use core::any::Any; |
nothing calls this directly
no test coverage detected