diff options
| author | bors <bors@rust-lang.org> | 2022-05-31 23:24:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-31 23:24:39 +0000 |
| commit | 6f481f8b715c6a26e43a86407e8839d7bf9a62f8 (patch) | |
| tree | a7815c315d7583604c21f371444e0f9bb63c6c97 /library/std/src | |
| parent | e0944922007e1bb4fe59809293acf4364410cccc (diff) | |
| parent | 31fccd1a446fee1e67ac264589487188d1d9d5e7 (diff) | |
| download | rust-6f481f8b715c6a26e43a86407e8839d7bf9a62f8.tar.gz rust-6f481f8b715c6a26e43a86407e8839d7bf9a62f8.zip | |
Auto merge of #97600 - matthiaskrgr:rollup-yivyeu5, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #97316 (Put a bound on collection misbehavior) - #97578 (alloc: remove repeated word in comment) - #97593 (:arrow_up: rust-analyzer) - #97596 (Fixup feature name to be more consistent with others) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/collections/hash/map.rs | 3 | ||||
| -rw-r--r-- | library/std/src/collections/hash/set.rs | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 969f5dde4f0..4ec423eb27f 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -54,7 +54,8 @@ use crate::sys; /// the [`Eq`] trait, changes while it is in the map. This is normally only /// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. /// The behavior resulting from such a logic error is not specified, but will -/// not result in undefined behavior. This could include panics, incorrect results, +/// be encapsulated to the `HashMap` that observed the logic error and not +/// result in undefined behavior. This could include panics, incorrect results, /// aborts, memory leaks, and non-termination. /// /// The hash table implementation is a Rust port of Google's [SwissTable]. diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 4ac0e081c2e..da0572047ec 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -33,13 +33,14 @@ use super::map::{map_try_reserve_error, RandomState}; /// In other words, if two keys are equal, their hashes must be equal. /// /// -/// It is a logic error for an item to be modified in such a way that the -/// item's hash, as determined by the [`Hash`] trait, or its equality, as -/// determined by the [`Eq`] trait, changes while it is in the set. This is -/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or -/// unsafe code. The behavior resulting from such a logic error is not -/// specified (it could include panics, incorrect results, aborts, memory -/// leaks, or non-termination) but will not be undefined behavior. +/// It is a logic error for a key to be modified in such a way that the key's +/// hash, as determined by the [`Hash`] trait, or its equality, as determined by +/// the [`Eq`] trait, changes while it is in the map. This is normally only +/// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. +/// The behavior resulting from such a logic error is not specified, but will +/// be encapsulated to the `HashSet` that observed the logic error and not +/// result in undefined behavior. This could include panics, incorrect results, +/// aborts, memory leaks, and non-termination. /// /// # Examples /// |
