()
| 1153 | // ownership of one strong count (per the contract), so decrementing it |
| 1154 | // is sound. |
| 1155 | unsafe { Arc::decrement_strong_count(this.cast::<Self>()) }; |
| 1156 | } |
| 1157 | } |
| 1158 | |
| 1159 | // ----------------------------------------------------------------------------- |
| 1160 | // Scope pointer |
| 1161 | |
| 1162 | mod scope_ptr { |
| 1163 | //! Defines a "lifetime-erased" reference-counting pointer to a scope. |
| 1164 | |
| 1165 | use alloc::boxed::Box; |
| 1166 | use core::any::Any; |
| 1167 | |
| 1168 | use super::Scope; |
| 1169 | |
| 1170 | /// A reference-counted pointer to a scope. Used to capture a scope pointer |
| 1171 | /// in jobs without faking a lifetime. Holding a `ScopePtr` keeps the |
| 1172 | /// reference scope from being deallocated. |
| 1173 | pub struct ScopePtr<'scope, 'env>(*const Scope<'scope, 'env>); |
| 1174 | |
| 1175 | // SAFETY: Sending the `*const Scope` is sound because the pointee outlives |
nothing calls this directly
no test coverage detected