Document from_raw_parts involves ownership transfer
This commit is contained in:
parent
6aba7be9a6
commit
f6be6aa92a
2 changed files with 12 additions and 0 deletions
|
@ -701,6 +701,12 @@ impl String {
|
||||||
/// Violating these may cause problems like corrupting the allocator's
|
/// Violating these may cause problems like corrupting the allocator's
|
||||||
/// internal datastructures.
|
/// internal datastructures.
|
||||||
///
|
///
|
||||||
|
/// The ownership of `ptr` is effectively transferred to the
|
||||||
|
/// `String` which may then deallocate, reallocate or change the
|
||||||
|
/// contents of memory pointed to by the pointer at will. Ensure
|
||||||
|
/// that nothing else uses the pointer after calling this
|
||||||
|
/// function.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// Basic usage:
|
/// Basic usage:
|
||||||
|
|
|
@ -348,6 +348,12 @@ impl<T> Vec<T> {
|
||||||
/// Violating these may cause problems like corrupting the allocator's
|
/// Violating these may cause problems like corrupting the allocator's
|
||||||
/// internal datastructures.
|
/// internal datastructures.
|
||||||
///
|
///
|
||||||
|
/// The ownership of `ptr` is effectively transferred to the
|
||||||
|
/// `Vec<T>` which may then deallocate, reallocate or change the
|
||||||
|
/// contents of memory pointed to by the pointer at will. Ensure
|
||||||
|
/// that nothing else uses the pointer after calling this
|
||||||
|
/// function.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue