Skip to content

Commit d91e9b7

Browse files
authored
Rollup merge of #87537 - Wilfred:improve-min-heap-docs, r=Mark-Simulacrum
Clarify undefined behaviour in binary heap, btree and hashset docs Previously, it wasn't clear whether "This could include" was referring to logic errors, or undefined behaviour. Tweak wording to clarify this sentence does not relate to UB.
2 parents 68a698b + 04c1ec5 commit d91e9b7

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

library/alloc/src/collections/binary_heap.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ use super::SpecExtend;
162162
/// item's ordering relative to any other item, as determined by the [`Ord`]
163163
/// trait, changes while it is in the heap. This is normally only possible
164164
/// through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. The
165-
/// behavior resulting from such a logic error is not specified, but will
166-
/// not result in undefined behavior. This could include panics, incorrect
167-
/// results, aborts, memory leaks, and non-termination.
165+
/// behavior resulting from such a logic error is not specified (it
166+
/// could include panics, incorrect results, aborts, memory leaks, or
167+
/// non-termination) but will not be undefined behavior.
168168
///
169169
/// # Examples
170170
///

library/alloc/src/collections/btree/map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
6161
/// It is a logic error for a key to be modified in such a way that the key's ordering relative to
6262
/// any other key, as determined by the [`Ord`] trait, changes while it is in the map. This is
6363
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
64-
/// The behavior resulting from such a logic error is not specified, but will not result in
65-
/// undefined behavior. This could include panics, incorrect results, aborts, memory leaks, and
66-
/// non-termination.
64+
/// The behavior resulting from such a logic error is not specified (it could include panics,
65+
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
66+
/// behavior.
6767
///
6868
/// [B-Tree]: https://en.wikipedia.org/wiki/B-tree
6969
/// [`Cell`]: core::cell::Cell

library/alloc/src/collections/btree/set.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ use super::Recover;
2323
/// It is a logic error for an item to be modified in such a way that the item's ordering relative
2424
/// to any other item, as determined by the [`Ord`] trait, changes while it is in the set. This is
2525
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
26-
/// The behavior resulting from such a logic error is not specified, but will not result in
27-
/// undefined behavior. This could include panics, incorrect results, aborts, memory leaks, and
28-
/// non-termination.
26+
/// The behavior resulting from such a logic error is not specified (it could include panics,
27+
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined
28+
/// behavior.
2929
///
3030
/// [`Ord`]: core::cmp::Ord
3131
/// [`Cell`]: core::cell::Cell

library/std/src/collections/hash/set.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ use super::map::{map_try_reserve_error, RandomState};
3838
/// determined by the [`Eq`] trait, changes while it is in the set. This is
3939
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or
4040
/// unsafe code. The behavior resulting from such a logic error is not
41-
/// specified, but will not result in undefined behavior. This could include
42-
/// panics, incorrect results, aborts, memory leaks, and non-termination.
41+
/// specified (it could include panics, incorrect results, aborts, memory
42+
/// leaks, or non-termination) but will not be undefined behavior.
4343
///
4444
/// # Examples
4545
///

0 commit comments

Comments
 (0)