about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-04 07:11:35 +0000
committerbors <bors@rust-lang.org>2018-09-04 07:11:35 +0000
commit4efc0a7811ee0e422dfc5d8a871b54160c18e35b (patch)
treef4448d41920f33aaf741e91eaf8f712aa1ed116d
parent8b80390ead05671f0344a6208891f152cbb7a68c (diff)
parentfe56878a242e17ca6bdc1d0cf71858f95facefa5 (diff)
Auto merge of #53928 - tbu-:pr_doc_fromrawmut, r=frewsxcv
Link to more detailed docs in `slice::from_raw_parts_mut`
-rw-r--r--src/libcore/slice/mod.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index f8c3feba74c..62adaea168a 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -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] {