Lines Matching full:safety
176 // SAFETY: An [`RBTree`] allows the same kinds of access to its values that a struct allows to its
180 // SAFETY: An [`RBTree`] allows the same kinds of access to its values that a struct allows to its
208 // SAFETY: by the invariants, all pointers are valid.
223 // SAFETY: by the invariants, all pointers are valid.
248 // SAFETY: `self.root` is always a valid root node.
263 // SAFETY: `self.root` is always a valid root node.
278 // SAFETY: `self.root` is always a valid root node.
293 // SAFETY: `self.root` is always a valid root node.
363 // SAFETY: `raw_self` is a valid pointer to the `RBTree` (created from `self` above).
367 // SAFETY: All links fields we create are in a `Node<K, V>`.
370 // SAFETY: `node` is a non-null node so it is valid by the type invariants.
372 // SAFETY: `curr` is a non-null node so it is valid by the type invariants.
374 // SAFETY: `curr` is a non-null node so it is valid by the type invariants.
414 // SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
418 // SAFETY: `this` is a non-null node so it is valid by the type invariants.
421 // SAFETY: `node` is a non-null node so it is valid by the type invariants.
499 // SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
502 // SAFETY: `this` is a non-null node so it is valid by the type invariants.
505 // SAFETY: `node` is a non-null node so it is valid by the type invariants.
510 // SAFETY: `this` is a non-null node so it is valid by the type invariants.
524 // SAFETY: `this` is a non-null node so it is valid by the type invariants.
543 // SAFETY: `root` is valid as it's embedded in `self` and we have a valid `self`.
548 // SAFETY: All links fields we create are in a `Node<K, V>`.
552 // SAFETY: `next` and all nodes in postorder are still valid.
558 // SAFETY: `this` is valid per the loop invariant.
819 // SAFETY: The immutable cursor gives out shared access to `K` and `V` so if `K` and `V` can be
823 // SAFETY: The immutable cursor gives out shared access to `K` and `V` so if `K` and `V` can be
830 // SAFETY:
836 /// # Safety
841 // SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
844 // SAFETY: The passed `node` is the current node or a non-null neighbor,
847 // SAFETY: The passed `node` is the current node or a non-null neighbor,
865 // SAFETY:
873 // SAFETY: `self.current` is valid by the type invariants.
885 // SAFETY: The [`CursorMut`] has exclusive access to both `K` and `V`, so it is sufficient to
892 // SAFETY: The [`CursorMut`] gives out immutable references to `K` and mutable references to `V`,
893 // so it has the same thread safety requirements as mutable references.
899 // SAFETY:
907 // SAFETY:
921 // SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
924 // SAFETY: `this` is valid by the type invariants as described above.
927 // SAFETY: The reference to the tree used to create the cursor outlives the cursor, so
954 // SAFETY: The reference to the tree used to create the cursor outlives the cursor, so
957 // SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
960 // SAFETY: `this` is valid by the type invariants as described above.
998 // SAFETY:
1017 // SAFETY:
1025 // SAFETY: `self.current` is valid by the type invariants.
1036 /// # Safety
1041 // SAFETY: the caller guarantees that `node` is a valid pointer in an `RBTree`.
1043 // SAFETY: the caller guarantees immutable access to `node`.
1047 /// # Safety
1052 // SAFETY: the caller guarantees that `node` is a valid pointer in an `RBTree`.
1054 // SAFETY: the caller guarantees mutable access to `node`.
1058 /// # Safety
1063 // SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
1066 // SAFETY: The passed `node` is the current node or a non-null neighbor,
1069 // SAFETY: The passed `node` is the current node or a non-null neighbor,
1101 // SAFETY: The [`Iter`] gives out immutable references to K and V, so it has the same
1102 // thread safety requirements as immutable references.
1105 // SAFETY: The [`Iter`] gives out immutable references to K and V, so it has the same
1106 // thread safety requirements as immutable references.
1113 // SAFETY: Due to `self._tree`, `k` and `v` are valid for the lifetime of `'a`.
1135 // SAFETY: The [`IterMut`] has exclusive access to both `K` and `V`, so it is sufficient to require them to be `Send`.
1140 // SAFETY: The [`IterMut`] gives out immutable references to K and mutable references to V, so it has the same
1141 // thread safety requirements as mutable references.
1149 // SAFETY: Due to `&mut self`, we have exclusive access to `k` and `v`, for the lifetime of `'a`.
1172 // SAFETY: By the type invariant of `IterRaw`, `self.next` is a valid node in an `RBTree`,
1176 // SAFETY: `self.next` is a valid tree node by the type invariants.
1179 // SAFETY: By the same reasoning above, it is safe to dereference the node.
1203 // SAFETY: This doesn't actually contain K or V, and is just a memory allocation. Those can always
1207 // SAFETY: This doesn't actually contain K or V, and is just a memory allocation.
1250 // SAFETY: If K and V can be sent across threads, then it's also okay to send [`RBTreeNode`] across
1254 // SAFETY: If K and V can be accessed without synchronization, then it's also okay to access
1321 // SAFETY: `node` is valid at least until we call `KBox::from_raw`, which only happens when
1327 // SAFETY: The type invariants of `RawVacantEntry` are exactly the safety requirements of `rb_link_node`.
1330 // SAFETY: All pointers are valid. `node` has just been inserted into the tree.
1333 // SAFETY: The node is valid until we remove it from the tree.
1358 // SAFETY:
1366 // SAFETY:
1376 // SAFETY:
1384 // SAFETY: The node is a node in the tree, so it is valid.
1390 // SAFETY: The node was a node in the tree, but we removed it, so we can convert it
1410 // SAFETY: `node` is valid at least until we call `KBox::from_raw`, which only happens when
1414 // SAFETY: This updates the pointers so that `new_node_links` is in the tree where
1420 // SAFETY: