diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 641f9eafa8d23..5e733fa43d705 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -411,7 +411,11 @@ impl Vec { /// /// Violating these may cause problems like corrupting the allocator's /// internal data structures. For example it is **not** safe - /// to build a `Vec` from a pointer to a C `char` array and a `size_t`. + /// to build a `Vec` from a pointer to a C `char` array with length `size_t`. + /// It's also not safe to build one from a `Vec` and its length, because + /// the allocator cares about the alignment, and these two types have different + /// alignments. The buffer was allocated with alignment 2 (for `u16`), but after + /// turning it into a `Vec` it'll be deallocated with alignment 1. /// /// The ownership of `ptr` is effectively transferred to the /// `Vec` which may then deallocate, reallocate or change the