File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -701,6 +701,12 @@ impl String {
701
701
/// Violating these may cause problems like corrupting the allocator's
702
702
/// internal datastructures.
703
703
///
704
+ /// The ownership of `ptr` is effectively transferred to the
705
+ /// `String` which may then deallocate, reallocate or change the
706
+ /// contents of memory pointed to by the pointer at will. Ensure
707
+ /// that nothing else uses the pointer after calling this
708
+ /// function.
709
+ ///
704
710
/// # Examples
705
711
///
706
712
/// Basic usage:
Original file line number Diff line number Diff line change @@ -342,12 +342,18 @@ impl<T> Vec<T> {
342
342
///
343
343
/// * `ptr` needs to have been previously allocated via `String`/`Vec<T>`
344
344
/// (at least, it's highly likely to be incorrect if it wasn't).
345
- /// * `length` needs to be the length that less than or equal to `capacity`.
345
+ /// * `length` needs to be less than or equal to `capacity`.
346
346
/// * `capacity` needs to be the capacity that the pointer was allocated with.
347
347
///
348
348
/// Violating these may cause problems like corrupting the allocator's
349
349
/// internal datastructures.
350
350
///
351
+ /// The ownership of `ptr` is effectively transferred to the
352
+ /// `Vec<T>` which may then deallocate, reallocate or change the
353
+ /// contents of memory pointed to by the pointer at will. Ensure
354
+ /// that nothing else uses the pointer after calling this
355
+ /// function.
356
+ ///
351
357
/// # Examples
352
358
///
353
359
/// ```
You can’t perform that action at this time.
0 commit comments