Fix example in transmute; add safety requirement to Vec::from_raw_parts
This commit is contained in:
parent
7eefed392f
commit
9dd2ee1942
2 changed files with 4 additions and 3 deletions
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue