diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-09-14 22:32:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-14 22:32:47 -0400 |
| commit | 3e478fd51226103660867d1bd6c9a78d38c1481b (patch) | |
| tree | a683bf6ac82f30e750662b28a636d511257a491a /src/liballoc | |
| parent | a48cc80d5711412e1c1aecafebd51f9b485965f1 (diff) | |
| parent | 9dd2ee1942b232246bd87805c2be471af9fad20a (diff) | |
| download | rust-3e478fd51226103660867d1bd6c9a78d38c1481b.tar.gz rust-3e478fd51226103660867d1bd6c9a78d38c1481b.zip | |
Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnik
Fix example in transmute; add safety requirement to Vec::from_raw_parts This fixes the second bullet point on #44281 and also removes some incorrect information.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index caca4010156..45574bad9ac 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -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. /// |
