about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2014-11-25 11:14:33 -0500
committerSteve Klabnik <steve@steveklabnik.com>2014-11-25 11:14:33 -0500
commit193b9e514c0bf004111f4df0dfa6dd7aaf21357f (patch)
tree7849afcb86d4f313b8b4ce4d1c7b3f7656cd828b
parent48ca6d1840818e4a8977d00ed62cf0e8e0e5d193 (diff)
downloadrust-193b9e514c0bf004111f4df0dfa6dd7aaf21357f.tar.gz
rust-193b9e514c0bf004111f4df0dfa6dd7aaf21357f.zip
Update documentation for from_raw_parts
Fixes #19269.
-rw-r--r--src/libcollections/vec.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index a3291e01942..51f07bedd2c 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -195,15 +195,9 @@ impl<T> Vec<T> {
         }
     }
 
-    /// Creates a `Vec<T>` directly from the raw constituents.
+    /// Creates a `Vec<T>` directly from the raw components of another vector.
     ///
-    /// This is highly unsafe:
-    ///
-    /// - if `ptr` is null, then `length` and `capacity` should be 0
-    /// - `ptr` must point to an allocation of size `capacity`
-    /// - there must be `length` valid instances of type `T` at the
-    ///   beginning of that allocation
-    /// - `ptr` must be allocated by the default `Vec` allocator
+    /// This is highly unsafe, due to the number of invariants that aren't checked.
     ///
     /// # Example
     ///