about summary refs log tree commit diff
path: root/library/core/src/alloc
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-05-30 12:57:38 +0200
committerGitHub <noreply@github.com>2023-05-30 12:57:38 +0200
commit18c9baf4fef69cee58991bfc5f8be1d8c14ef979 (patch)
tree85866fe570a6be0ee827fe0a831a1f3739973d07 /library/core/src/alloc
parent578bcbc2b42191556c4438b80ba37fafa4193e82 (diff)
parent000cd9b5fb9aad0c4fc3e3172387aac79d50a1d3 (diff)
downloadrust-18c9baf4fef69cee58991bfc5f8be1d8c14ef979.tar.gz
rust-18c9baf4fef69cee58991bfc5f8be1d8c14ef979.zip
Rollup merge of #107916 - reez12g:issue-107040, r=Amanieu
fix comment on Allocator trait

fixes https://github.com/rust-lang/rust/issues/107040
Diffstat (limited to 'library/core/src/alloc')
-rw-r--r--library/core/src/alloc/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs
index d6ae2b8213f..78091c01729 100644
--- a/library/core/src/alloc/mod.rs
+++ b/library/core/src/alloc/mod.rs
@@ -94,8 +94,9 @@ impl fmt::Display for AllocError {
 ///
 /// # Safety
 ///
-/// * Memory blocks returned from an allocator must point to valid memory and retain their validity
-///   until the instance and all of its copies and clones are dropped,
+/// * Memory blocks returned from an allocator that are [*currently allocated*] must point to
+///   valid memory and retain their validity while they are [*currently allocated*] and at
+///   least one of the instance and all of its clones has not been dropped.
 ///
 /// * copying, cloning, or moving the allocator must not invalidate memory blocks returned from this
 ///   allocator. A copied or cloned allocator must behave like the same allocator, and