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
@ -370,7 +370,8 @@ pub fn with_capacity(capacity: usize) -> 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…
Reference in New Issue
Block a user