Lines Matching full:safety
43 // SAFETY: This is a container of `ListArc<T, ID>`, and access to the container allows the same
51 // SAFETY: This is a container of `ListArc<T, ID>`, and access to the container allows the same
62 /// # Safety
79 /// # Safety
93 /// # Safety
109 /// # Safety
126 /// # Safety
152 // SAFETY: The only way to access/modify the pointers inside of `ListLinks<ID>` is via holding the
156 // SAFETY: The type is opaque so immutable references to a ListLinks are useless. Therefore, it's
173 /// # Safety
178 // SAFETY: The caller promises that the pointer is valid. in fields()
182 /// # Safety
205 // SAFETY: The fields of a ListLinksSelfPtr can be moved across thread boundaries.
207 // SAFETY: The type is opaque so immutable references to a ListLinksSelfPtr are useless. Therefore,
251 // SAFETY: in push_back()
259 // SAFETY: We have not yet called `post_remove`, so `list_links` is still valid. in push_back()
264 // SAFETY: The caller just gave us ownership of these fields. in push_back()
272 // SAFETY: By the type invariant, this pointer is valid or null. We just checked that in push_back()
275 // SAFETY: Pointers in a linked list are never dangling, and the caller just gave us in push_back()
290 // SAFETY: in push_front()
293 // violated the safety requirement that they can't give up ownership of the `ListArc` in push_front()
299 // SAFETY: We have not yet called `post_remove`, so `list_links` is still valid. in push_front()
303 // SAFETY: The caller just gave us ownership of these fields. in push_front()
311 // SAFETY: We just checked that `next` is non-null. in push_front()
313 // SAFETY: Pointers in a linked list are never dangling, and the caller just gave us in push_front()
332 // SAFETY: We just checked that the list is not empty. in pop_back()
334 // SAFETY: The last item of this list is in this list. in pop_back()
344 // SAFETY: The first item of this list is in this list. in pop_front()
350 /// This returns `None` if the item is not in the list. (Note that by the safety requirements,
353 /// # Safety
357 // SAFETY: TODO. in remove()
359 // SAFETY: The user provided a reference, and reference are never dangling. in remove()
377 // SAFETY: We just checked that `next` is not null, and it's not dangling by the in remove()
384 // SAFETY: We just checked that `item` is in a list, so the caller guarantees that it in remove()
394 /// # Safety
398 // SAFETY: The caller promises that this pointer is not dangling, and there's no data race in remove_internal()
401 // SAFETY: The pointers are ok and in the right order. in remove_internal()
407 /// # Safety
417 // SAFETY: We have exclusive access to the pointers of items in the list, and the prev/next in remove_internal_inner()
430 // SAFETY: We have exclusive access to items in the list. in remove_internal_inner()
445 // SAFETY: The `prev` pointer is the value that `item->prev` had when it was in this in remove_internal_inner()
451 // SAFETY: `item` used to be in the list, so it is dereferenceable by the type invariants in remove_internal_inner()
454 // SAFETY: Any pointer in the list originates from a `prepare_to_insert` call. in remove_internal_inner()
456 // SAFETY: The above call to `post_remove` guarantees that we can recreate the `ListArc`. in remove_internal_inner()
471 // SAFETY: The other list is not empty, so this pointer is valid. in push_all_back()
474 // SAFETY: The self list is not empty, so this pointer is valid. in push_all_back()
477 // SAFETY: We have exclusive access to both lists, so we can update the pointers. in push_all_back()
556 // SAFETY: We just checked that `current` is not null, so it is in a list, and hence not in next()
567 // SAFETY: The `current` pointer points at a value in the list. in next()
569 // SAFETY: in next()
593 // SAFETY: The `current` pointer points a value in the list. in current()
595 // SAFETY: in current()
609 // SAFETY: The `current` field is always in a list. in next()
626 // SAFETY: The `current` field is always in a list. in prev()
643 // SAFETY: The `current` pointer always points at a member of the list. in remove()