about summary refs log tree commit diff
diff options
context:
space:
mode:
authorderekdreery <rodododouk@hotmail.com>2017-01-06 15:58:35 +0000
committerGitHub <noreply@github.com>2017-01-06 15:58:35 +0000
commit5cb37f6331cb97a0d644d3ff753e73dd7bf66604 (patch)
treeb6beb363a65b1b1abd6ab92ad94b34179c170257
parent0728b710347aa80dfc05de29bfed4ed5fc023818 (diff)
downloadrust-5cb37f6331cb97a0d644d3ff753e73dd7bf66604.tar.gz
rust-5cb37f6331cb97a0d644d3ff753e73dd7bf66604.zip
Update vec.rs
Add a warning not to convert  char* from c to Vec<u8> (I thought you could until I asked on irc)
-rw-r--r--src/libcollections/vec.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index f2ef54f6e56..3c9a9897fea 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -370,7 +370,8 @@ impl<T> Vec<T> {
     /// * `capacity` needs to be the capacity that the pointer was allocated with.
     ///
     /// Violating these may cause problems like corrupting the allocator's
-    /// internal datastructures.
+    /// internal datastructures. For example it is **not** safe
+    /// to build a `Vec<u8>` from a C pointer to a char array and a `size_t`.
     ///
     /// The ownership of `ptr` is effectively transferred to the
     /// `Vec<T>` which may then deallocate, reallocate or change the