summaryrefslogtreecommitdiff
path: root/rust/kernel/rbtree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/kernel/rbtree.rs')
-rw-r--r--rust/kernel/rbtree.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/rust/kernel/rbtree.rs b/rust/kernel/rbtree.rs
index 0d1e75810664..5246b2c8a4ff 100644
--- a/rust/kernel/rbtree.rs
+++ b/rust/kernel/rbtree.rs
@@ -886,7 +886,7 @@ impl<'a, K, V> Cursor<'a, K, V> {
/// # Safety
///
/// - `node` must be a valid pointer to a node in an [`RBTree`].
- /// - The caller has immutable access to `node` for the duration of 'b.
+ /// - The caller has immutable access to `node` for the duration of `'b`.
unsafe fn to_key_value<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, &'b V) {
// SAFETY: the caller guarantees that `node` is a valid pointer in an `RBTree`.
let (k, v) = unsafe { Self::to_key_value_raw(node) };
@@ -897,7 +897,7 @@ impl<'a, K, V> Cursor<'a, K, V> {
/// # Safety
///
/// - `node` must be a valid pointer to a node in an [`RBTree`].
- /// - The caller has mutable access to `node` for the duration of 'b.
+ /// - The caller has mutable access to `node` for the duration of `'b`.
unsafe fn to_key_value_mut<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, &'b mut V) {
// SAFETY: the caller guarantees that `node` is a valid pointer in an `RBTree`.
let (k, v) = unsafe { Self::to_key_value_raw(node) };
@@ -908,7 +908,7 @@ impl<'a, K, V> Cursor<'a, K, V> {
/// # Safety
///
/// - `node` must be a valid pointer to a node in an [`RBTree`].
- /// - The caller has immutable access to the key for the duration of 'b.
+ /// - The caller has immutable access to the key for the duration of `'b`.
unsafe fn to_key_value_raw<'b>(node: NonNull<bindings::rb_node>) -> (&'b K, *mut V) {
// SAFETY: By the type invariant of `Self`, all non-null `rb_node` pointers stored in `self`
// point to the links field of `Node<K, V>` objects.
@@ -1168,12 +1168,12 @@ impl<'a, K, V> RawVacantEntry<'a, K, V> {
fn insert(self, node: RBTreeNode<K, V>) -> &'a mut V {
let node = KBox::into_raw(node.node);
- // SAFETY: `node` is valid at least until we call `Box::from_raw`, which only happens when
+ // SAFETY: `node` is valid at least until we call `KBox::from_raw`, which only happens when
// the node is removed or replaced.
let node_links = unsafe { addr_of_mut!((*node).links) };
// INVARIANT: We are linking in a new node, which is valid. It remains valid because we
- // "forgot" it with `Box::into_raw`.
+ // "forgot" it with `KBox::into_raw`.
// SAFETY: The type invariants of `RawVacantEntry` are exactly the safety requirements of `rb_link_node`.
unsafe { bindings::rb_link_node(node_links, self.parent, self.child_field_of_parent) };
@@ -1259,7 +1259,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
fn replace(self, node: RBTreeNode<K, V>) -> RBTreeNode<K, V> {
let node = KBox::into_raw(node.node);
- // SAFETY: `node` is valid at least until we call `Box::from_raw`, which only happens when
+ // SAFETY: `node` is valid at least until we call `KBox::from_raw`, which only happens when
// the node is removed or replaced.
let new_node_links = unsafe { addr_of_mut!((*node).links) };