Skip to content

Commit

Permalink
Auto merge of #53928 - tbu-:pr_doc_fromrawmut, r=frewsxcv
Browse files Browse the repository at this point in the history
Link to more detailed docs in `slice::from_raw_parts_mut`
  • Loading branch information
bors committed Sep 4, 2018
2 parents 8b80390 + fe56878 commit 4efc0a7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3879,13 +3879,16 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
Repr { raw: FatPtr { data, len } }.rust
}

/// Performs the same functionality as `from_raw_parts`, except that a mutable
/// slice is returned.
/// Performs the same functionality as [`from_raw_parts`], except that a
/// mutable slice is returned.
///
/// This function is unsafe for the same reasons as `from_raw_parts`, as well
/// This function is unsafe for the same reasons as [`from_raw_parts`], as well
/// as not being able to provide a non-aliasing guarantee of the returned
/// mutable slice. `data` must be non-null and aligned even for zero-length
/// slices as with `from_raw_parts`.
/// slices as with [`from_raw_parts`]. See the documentation of
/// [`from_raw_parts`] for more details.
///
/// [`from_raw_parts`]: ../../std/slice/fn.from_raw_parts.html
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T] {
Expand Down

0 comments on commit 4efc0a7

Please sign in to comment.