Rollup merge of #27081 - rick68:patch-15, r=alexcrichton
improve the 'Unsafety' section of `collections::vec::Vec::<T>::from_raw_parts`.
This commit is contained in:
commit
2ea87785be
1 changed files with 1 additions and 0 deletions
|
|
@ -231,6 +231,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).
|
||||
/// * `length` needs to be the length that less than or equal to `capacity`.
|
||||
/// * `capacity` needs to be the capacity that the pointer was allocated with.
|
||||
///
|
||||
/// Violating these may cause problems like corrupting the allocator's
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue