Lines Matching full:safety
153 /// # Safety
159 // SAFETY: The caller guarantees that the pointer is valid. in container_of()
161 // SAFETY: We're computing the layout of a real struct that existed when compiling this in container_of()
172 // SAFETY: The pointer is in-bounds of an allocation both before and after offsetting the in container_of()
177 // SAFETY: The pointer can't be null since you can't have an `ArcInner<T>` value at the null in container_of()
192 // SAFETY: It is safe to send `Arc<T>` to another thread when the underlying `T` is `Sync` because
198 // SAFETY: It is safe to send `&Arc<T>` to another thread when the underlying `T` is `Sync`
210 // SAFETY: There are no safety requirements for this FFI call. in new()
218 // SAFETY: We just created `inner` with a reference count of 1, which is owned by the new in new()
227 /// # Safety
232 // INVARIANT: By the safety requirements, the invariants hold. in from_inner()
245 // SAFETY: The pointer is valid. in into_raw()
251 /// # Safety
256 // SAFETY: The caller promises that this pointer originates from a call to `into_raw` on an in from_raw()
260 // SAFETY: By the safety requirements we know that `ptr` came from `Arc::into_raw`, so the in from_raw()
271 // SAFETY: The constraint that the lifetime of the shared reference must outlive that of in as_arc_borrow()
319 // SAFETY: We own a refcount, so the pointer is still valid. in into_unique_or_drop()
326 // SAFETY: We own a refcount, so the pointer is not dangling. in into_unique_or_drop()
329 // SAFETY: We have exclusive access to the arc, so we can perform unsynchronized in into_unique_or_drop()
354 // SAFETY: The safety requirements of this function ensure that `ptr` comes from a previous in from_foreign()
358 // SAFETY: By the safety requirement of this function, we know that `ptr` came from in from_foreign()
365 // SAFETY: The safety requirements of this function ensure that `ptr` comes from a previous in borrow()
369 // SAFETY: The safety requirements of `from_foreign` ensure that the object remains alive in borrow()
375 // SAFETY: The safety requirements for `borrow_mut` are a superset of the safety in borrow_mut()
385 // SAFETY: By the type invariant, there is necessarily a reference to the object, so it is in deref()
399 // SAFETY: By the type invariant, there is necessarily a reference to the object, so it is in clone()
404 // SAFETY: By the type invariant, there is necessarily a reference to the object, so it is in clone()
408 // SAFETY: We just incremented the refcount. This increment is now owned by the new `Arc`. in clone()
415 // SAFETY: By the type invariant, there is necessarily a reference to the object. We cannot in drop()
423 // SAFETY: Also by the type invariant, we are allowed to decrement the refcount. in drop()
428 // SAFETY: The pointer was initialised from the result of `KBox::leak`. in drop()
442 // SAFETY: The type invariants of `Arc` guarantee that the data is pinned. in from()
528 /// # Safety
534 // INVARIANT: The safety requirements guarantee the invariants. in new()
544 /// # Safety
552 // SAFETY: The caller promises that this pointer originates from a call to `into_raw` on an in from_raw()
556 // SAFETY: The caller promises that the value remains valid since the reference count must in from_raw()
565 // SAFETY: The existence of `b` guarantees that the refcount is non-zero. `ManuallyDrop` in from()
578 // SAFETY: By the type invariant, the underlying object is still alive with no mutable in deref()
676 // SAFETY: There are no safety requirements for this FFI call. in new_uninit()
684 // SAFETY: The pointer from the `KBox` is valid. in new_uninit()
694 // SAFETY: We just wrote the value to be initialized. in write()
700 /// # Safety
707 // SAFETY: The new `Arc` is taking over `ptr` from `self.inner` (which won't be in assume_init()
715 // SAFETY: The supplied pointer is valid for initialization. in init_with()
717 // SAFETY: Initialization completed successfully. in init_with()
728 // SAFETY: The supplied pointer is valid for initialization and we will later pin the value in pin_init_with()
731 // SAFETY: Initialization completed successfully. in pin_init_with()
740 // SAFETY: It is not possible to move/replace `T` inside a `Pin<UniqueArc<T>>` (unless `T` in from()
756 // SAFETY: By the `Arc` type invariant, there is necessarily a reference to the object, so in deref_mut()