about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWei-Ming Yang <rick68@users.noreply.github.com>2015-07-17 15:47:14 +0800
committerWei-Ming Yang <rick68@users.noreply.github.com>2015-07-17 15:47:14 +0800
commit10702319872e2dddb59d1400fe74357f5a98e712 (patch)
tree4e54947a0e9374863253025e415387f6b6dcac3c
parente4e93196e16030ebf7a20c473849534235d676f8 (diff)
Update vec.rs
improve the 'Unsafety' section of `collections::vec::Vec::<T>::from_raw_parts`.
-rw-r--r--src/libcollections/vec.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 3848263c530..2127ac11436 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -231,6 +231,7 @@ impl<T> Vec<T> {
     ///
     /// * `ptr` needs to have been previously allocated via `String`/`Vec<T>`
     ///   (at least, it's highly likely to be incorrect if it wasn't).
+    /// * `length` needs to be the length that less than or equal to `capacity`.
     /// * `capacity` needs to be the capacity that the pointer was allocated with.
     ///
     /// Violating these may cause problems like corrupting the allocator's