File tree 1 file changed +5
-1
lines changed
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> {
404
404
///
405
405
/// * `ptr` needs to have been previously allocated via [`String`]/`Vec<T>`
406
406
/// (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.)
408
411
/// * `length` needs to be less than or equal to `capacity`.
409
412
/// * `capacity` needs to be the capacity that the pointer was allocated with.
410
413
///
@@ -423,6 +426,7 @@ impl<T> Vec<T> {
423
426
/// function.
424
427
///
425
428
/// [`String`]: ../../std/string/struct.String.html
429
+ /// [`dealloc`]: ../../alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc
426
430
///
427
431
/// # Examples
428
432
///
You can’t perform that action at this time.
0 commit comments