Rollup merge of #77442 - pickfire:patch-7, r=scottmcm

Clean up on example doc fixes for ptr::copy

Follow up of #77385

r? @scottmcm
This commit is contained in:
Jonas Schievink 2020-10-02 20:27:14 +02:00 committed by GitHub
commit 14d8ee3465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1901,9 +1901,10 @@ pub unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
/// ```
/// use std::ptr;
///
/// /// # Safety:
/// /// # Safety
/// ///
/// /// * `ptr` must be correctly aligned for its type and non-zero.
/// /// * `ptr` must be valid for reads of `elts` contiguous objects of type `T`.
/// /// * `ptr` must be valid for reads of `elts` contiguous elements of type `T`.
/// /// * Those elements must not be used after calling this function unless `T: Copy`.
/// # #[allow(dead_code)]
/// unsafe fn from_buf_raw<T>(ptr: *const T, elts: usize) -> Vec<T> {