Lines Matching full:safety
150 // SAFETY: It is safe to send `Arc<T>` to another thread when the underlying `T` is `Sync` because
156 // SAFETY: It is safe to send `&Arc<T>` to another thread when the underlying `T` is `Sync`
168 // SAFETY: There are no safety requirements for this FFI call. in try_new()
175 // SAFETY: We just created `inner` with a reference count of 1, which is owned by the new in try_new()
206 /// # Safety
211 // INVARIANT: By the safety requirements, the invariants hold. in from_inner()
224 // SAFETY: The pointer is valid. in into_raw()
230 /// # Safety
236 // SAFETY: The caller guarantees that the pointer is valid. in from_raw()
238 // SAFETY: We're computing the layout of a real struct that existed when compiling this in from_raw()
243 // SAFETY: The metadata of `T` and `ArcInner<T>` is the same because `ArcInner` is a struct in from_raw()
250 // SAFETY: The pointer is in-bounds of an allocation both before and after offsetting the in from_raw()
255 // SAFETY: By the safety requirements we know that `ptr` came from `Arc::into_raw`, so the in from_raw()
266 // SAFETY: The constraint that the lifetime of the shared reference must outlive that of in as_arc_borrow()
286 // SAFETY: By the safety requirement of this function, we know that `ptr` came from in borrow()
290 // SAFETY: The safety requirements of `from_foreign` ensure that the object remains alive in borrow()
296 // SAFETY: By the safety requirement of this function, we know that `ptr` came from in from_foreign()
307 // SAFETY: By the type invariant, there is necessarily a reference to the object, so it is in deref()
322 // SAFETY: By the type invariant, there is necessarily a reference to the object, so it is in clone()
326 // SAFETY: We just incremented the refcount. This increment is now owned by the new `Arc`. in clone()
333 // SAFETY: By the type invariant, there is necessarily a reference to the object. We cannot in drop()
341 // SAFETY: Also by the type invariant, we are allowed to decrement the refcount. in drop()
346 // SAFETY: The pointer was initialised from the result of `Box::leak`. in drop()
360 // SAFETY: The type invariants of `Arc` guarantee that the data is pinned. in from()
446 /// # Safety
452 // INVARIANT: The safety requirements guarantee the invariants. in new()
462 // SAFETY: The existence of `b` guarantees that the refcount is non-zero. `ManuallyDrop` in from()
475 // SAFETY: By the type invariant, the underlying object is still alive with no mutable in deref()
572 // SAFETY: There are no safety requirements for this FFI call. in try_new_uninit()
578 // SAFETY: The pointer from the `Box` is valid. in try_new_uninit()
588 // SAFETY: We just wrote the value to be initialized. in write()
594 /// # Safety
601 // SAFETY: The new `Arc` is taking over `ptr` from `self.inner` (which won't be in assume_init()
609 // SAFETY: The supplied pointer is valid for initialization. in init_with()
611 // SAFETY: Initialization completed successfully. in init_with()
622 // SAFETY: The supplied pointer is valid for initialization and we will later pin the value in pin_init_with()
625 // SAFETY: Initialization completed successfully. in pin_init_with()
634 // SAFETY: It is not possible to move/replace `T` inside a `Pin<UniqueArc<T>>` (unless `T` in from()
650 // SAFETY: By the `Arc` type invariant, there is necessarily a reference to the object, so in deref_mut()