about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-07-27 13:32:56 -0400
committerGitHub <noreply@github.com>2024-07-27 13:32:56 -0400
commit51734a8a6d0ac6741b715cb726b7d0ed774484a5 (patch)
treee9c52df7bf457838d9b0d54380a4e2099f86937b /library/alloc/src
parent8fe0c753f23e7050b87a444b6622caf4d2272d5d (diff)
parent05b7f282e8a883005237833f3bbc972072111e74 (diff)
downloadrust-51734a8a6d0ac6741b715cb726b7d0ed774484a5.tar.gz
rust-51734a8a6d0ac6741b715cb726b7d0ed774484a5.zip
Rollup merge of #125897 - RalfJung:from-ref, r=Amanieu
from_ref, from_mut: clarify documentation

This was brought up [here](https://github.com/rust-lang/rust/issues/56604#issuecomment-2143193486). The domain of quantification is generally always constrained by the type in the type signature, and I am not sure it's always worth spelling that out explicitly as that makes things exceedingly verbose. But since this was explicitly brought up, let's clarify.
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/vec/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 729d5dd4fe4..f63a6dd6749 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -1277,7 +1277,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// valid for zero sized reads if the vector didn't allocate.
     ///
     /// The caller must ensure that the vector outlives the pointer this
-    /// function returns, or else it will end up pointing to garbage.
+    /// function returns, or else it will end up dangling.
     /// Modifying the vector may cause its buffer to be reallocated,
     /// which would also make any pointers to it invalid.
     ///
@@ -1337,7 +1337,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// raw pointer valid for zero sized reads if the vector didn't allocate.
     ///
     /// The caller must ensure that the vector outlives the pointer this
-    /// function returns, or else it will end up pointing to garbage.
+    /// function returns, or else it will end up dangling.
     /// Modifying the vector may cause its buffer to be reallocated,
     /// which would also make any pointers to it invalid.
     ///