Fix example in transmute; add safety requirement to Vec::from_raw_parts
This commit is contained in:
@@ -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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user