Update vec.rs
Add a warning not to convert char* from c to Vec<u8> (I thought you could until I asked on irc)
This commit is contained in:
parent
0728b71034
commit
5cb37f6331
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue