about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorHavvy <ryan.havvy@gmail.com>2017-09-13 01:27:41 -0700
committerHavvy <ryan.havvy@gmail.com>2017-09-13 04:27:40 -0700
commit9dd2ee1942b232246bd87805c2be471af9fad20a (patch)
treec3b833abe56ac37280d733b28632d0600f850b20 /src/liballoc
parent7eefed392f926958233529f6c1307aa007802046 (diff)
downloadrust-9dd2ee1942b232246bd87805c2be471af9fad20a.tar.gz
rust-9dd2ee1942b232246bd87805c2be471af9fad20a.zip
Fix example in transmute; add safety requirement to Vec::from_raw_parts
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/vec.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs
index 8141851b8c9..87b2b3f7a40 100644
--- a/src/liballoc/vec.rs
+++ b/src/liballoc/vec.rs
@@ -370,6 +370,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).
+    /// * `ptr`'s `T` needs to have the same size and alignment as it was allocated with.
     /// * `length` needs to be less than or equal to `capacity`.
     /// * `capacity` needs to be the capacity that the pointer was allocated with.
     ///