From 10702319872e2dddb59d1400fe74357f5a98e712 Mon Sep 17 00:00:00 2001 From: Wei-Ming Yang Date: Fri, 17 Jul 2015 15:47:14 +0800 Subject: [PATCH] Update vec.rs improve the 'Unsafety' section of `collections::vec::Vec::::from_raw_parts`. --- src/libcollections/vec.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 3848263c53097..2127ac11436b1 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -231,6 +231,7 @@ impl Vec { /// /// * `ptr` needs to have been previously allocated via `String`/`Vec` /// (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