1
Fork 0

Document from_raw_parts involves ownership transfer

This commit is contained in:
Jake Goulding 2016-07-17 10:52:59 -04:00
parent 6aba7be9a6
commit f6be6aa92a
2 changed files with 12 additions and 0 deletions

View file

@ -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:

View file

@ -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
/// ///
/// ``` /// ```