From 6763561161dff2419ffe9795ec8bc40671c16e9e Mon Sep 17 00:00:00 2001 From: Bart Jacobs Date: Tue, 28 Jan 2025 21:42:51 +0100 Subject: [PATCH 1/2] btree/node.rs: remove incorrect comment from pop_internal_level docs --- library/alloc/src/collections/btree/node.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 6815ac1c19305..2525f5856cd21 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -600,9 +600,6 @@ impl NodeRef { /// no cleanup is done on any of the keys, values and other children. /// This decreases the height by 1 and is the opposite of `push_internal_level`. /// - /// Requires exclusive access to the `NodeRef` object but not to the root node; - /// it will not invalidate other handles or references to the root node. - /// /// Panics if there is no internal level, i.e., if the root node is a leaf. pub(super) fn pop_internal_level(&mut self, alloc: A) { assert!(self.height > 0); From 810e4c1bc62a4801a4c29fe6c975630acbd78370 Mon Sep 17 00:00:00 2001 From: Bart Jacobs Date: Wed, 29 Jan 2025 08:35:29 +0100 Subject: [PATCH 2/2] btree/node.rs: pop_internal_level: does not invalidate other handles --- library/alloc/src/collections/btree/node.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/alloc/src/collections/btree/node.rs b/library/alloc/src/collections/btree/node.rs index 2525f5856cd21..37f784a322cad 100644 --- a/library/alloc/src/collections/btree/node.rs +++ b/library/alloc/src/collections/btree/node.rs @@ -600,6 +600,9 @@ impl NodeRef { /// no cleanup is done on any of the keys, values and other children. /// This decreases the height by 1 and is the opposite of `push_internal_level`. /// + /// Does not invalidate any handles or references pointing into the subtree + /// rooted at the first child of `self`. + /// /// Panics if there is no internal level, i.e., if the root node is a leaf. pub(super) fn pop_internal_level(&mut self, alloc: A) { assert!(self.height > 0);