File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -404,7 +404,10 @@ impl<T> Vec<T> {
404404 ///
405405 /// * `ptr` needs to have been previously allocated via [`String`]/`Vec<T>`
406406 /// (at least, it's highly likely to be incorrect if it wasn't).
407- /// * `ptr`'s `T` needs to have the same size and alignment as it was allocated with.
407+ /// * `T` needs to have the same size and alignment as what `ptr` was allocated with.
408+ /// (`T` having a less strict alignment is not sufficient, the alignment really
409+ /// needs to be equal to satsify the [`dealloc`] requirement that memory must be
410+ /// allocated and deallocated with the same layout.)
408411 /// * `length` needs to be less than or equal to `capacity`.
409412 /// * `capacity` needs to be the capacity that the pointer was allocated with.
410413 ///
@@ -423,6 +426,7 @@ impl<T> Vec<T> {
423426 /// function.
424427 ///
425428 /// [`String`]: ../../std/string/struct.String.html
429+ /// [`dealloc`]: ../../alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc
426430 ///
427431 /// # Examples
428432 ///
You can’t perform that action at this time.
0 commit comments