1
Fork 0

Fix example in transmute; add safety requirement to Vec::from_raw_parts

This commit is contained in:
Havvy 2017-09-13 01:27:41 -07:00
parent 7eefed392f
commit 9dd2ee1942
2 changed files with 4 additions and 3 deletions

View file

@ -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.
///