about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJake Goulding <jake.goulding@gmail.com>2016-07-17 10:52:59 -0400
committerJake Goulding <jake.goulding@gmail.com>2016-07-17 18:18:49 -0400
commitf6be6aa92acd34d3a8815e29bb09b7ec2a72fedc (patch)
tree81cf6a93136f1434311535a174abc74324740753 /src
parent6aba7be9a67467d31e6cbf75dc8b5f44d60cb5ca (diff)
downloadrust-f6be6aa92acd34d3a8815e29bb09b7ec2a72fedc.tar.gz
rust-f6be6aa92acd34d3a8815e29bb09b7ec2a72fedc.zip
Document from_raw_parts involves ownership transfer
Diffstat (limited to 'src')
-rw-r--r--src/libcollections/string.rs6
-rw-r--r--src/libcollections/vec.rs6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index eedf4c2c11f..8ba5c6ffbf2 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -701,6 +701,12 @@ impl String {
     /// Violating these may cause problems like corrupting the allocator's
     /// internal datastructures.
     ///
+    /// The ownership of `ptr` is effectively transferred to the
+    /// `String` which may then deallocate, reallocate or change the
+    /// contents of memory pointed to by the pointer at will. Ensure
+    /// that nothing else uses the pointer after calling this
+    /// function.
+    ///
     /// # Examples
     ///
     /// Basic usage:
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index da56b21cf0c..98b5c4663cd 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -348,6 +348,12 @@ impl<T> Vec<T> {
     /// Violating these may cause problems like corrupting the allocator's
     /// internal datastructures.
     ///
+    /// The ownership of `ptr` is effectively transferred to the
+    /// `Vec<T>` which may then deallocate, reallocate or change the
+    /// contents of memory pointed to by the pointer at will. Ensure
+    /// that nothing else uses the pointer after calling this
+    /// function.
+    ///
     /// # Examples
     ///
     /// ```