Lines Matching full:safety
46 // SAFETY: This is a container of `ListArc<T, ID>`, and access to the container allows the same
54 // SAFETY: This is a container of `ListArc<T, ID>`, and access to the container allows the same
65 /// # Safety
82 /// # Safety
96 /// # Safety
112 /// # Safety
129 /// # Safety
155 // SAFETY: The only way to access/modify the pointers inside of `ListLinks<ID>` is via holding the
159 // SAFETY: The type is opaque so immutable references to a ListLinks are useless. Therefore, it's
176 /// # Safety
181 // SAFETY: The caller promises that the pointer is valid. in fields()
185 /// # Safety
208 // SAFETY: The fields of a ListLinksSelfPtr can be moved across thread boundaries.
210 // SAFETY: The type is opaque so immutable references to a ListLinksSelfPtr are useless. Therefore,
256 /// # Safety
266 // SAFETY: in insert_inner()
274 // SAFETY: We have not yet called `post_remove`, so `list_links` is still valid. in insert_inner()
279 // SAFETY: The caller just gave us ownership of these fields. in insert_inner()
287 // SAFETY: By the type invariant, this pointer is valid or null. We just checked that in insert_inner()
290 // SAFETY: Pointers in a linked list are never dangling, and the caller just gave us in insert_inner()
306 // SAFETY: in push_back()
314 // SAFETY: in push_front()
329 // SAFETY: We just checked that the list is not empty. in pop_back()
331 // SAFETY: The last item of this list is in this list. in pop_back()
341 // SAFETY: The first item of this list is in this list. in pop_front()
347 /// This returns `None` if the item is not in the list. (Note that by the safety requirements,
350 /// # Safety
354 // SAFETY: TODO. in remove()
356 // SAFETY: The user provided a reference, and reference are never dangling. in remove()
374 // SAFETY: We just checked that `next` is not null, and it's not dangling by the in remove()
381 // SAFETY: We just checked that `item` is in a list, so the caller guarantees that it in remove()
391 /// # Safety
395 // SAFETY: The caller promises that this pointer is not dangling, and there's no data race in remove_internal()
398 // SAFETY: The pointers are ok and in the right order. in remove_internal()
404 /// # Safety
414 // SAFETY: We have exclusive access to the pointers of items in the list, and the prev/next in remove_internal_inner()
427 // SAFETY: We have exclusive access to items in the list. in remove_internal_inner()
442 // SAFETY: The `prev` pointer is the value that `item->prev` had when it was in this in remove_internal_inner()
448 // SAFETY: `item` used to be in the list, so it is dereferenceable by the type invariants in remove_internal_inner()
451 // SAFETY: Any pointer in the list originates from a `prepare_to_insert` call. in remove_internal_inner()
453 // SAFETY: The above call to `post_remove` guarantees that we can recreate the `ListArc`. in remove_internal_inner()
468 // SAFETY: The other list is not empty, so this pointer is valid. in push_all_back()
471 // SAFETY: The self list is not empty, so this pointer is valid. in push_all_back()
474 // SAFETY: We have exclusive access to both lists, so we can update the pointers. in push_all_back()
557 // SAFETY: We just checked that `current` is not null, so it is in a list, and hence not in next()
568 // SAFETY: The `current` pointer points at a value in the list. in next()
570 // SAFETY: in next()
743 // SAFETY: `next` can't be null, because then `first` must also be null, but in that case in prev_ptr()
790 // SAFETY: `self.next` is an element in the list and we borrow the list mutably, so we can in move_next()
824 // SAFETY: in insert_inner()
891 // SAFETY: By the type invariants of `Self`, `next` is not null, so `next` is an element of in remove()
898 // SAFETY: `self.ptr` points at an element in `self.cursor.list`. in arc()
900 // SAFETY: in arc()
925 // SAFETY: `self.ptr` points at an element in `self.cursor.list`. in deref()
928 // SAFETY: The value cannot be removed from the list for the duration of the lifetime in deref()