Skip to content

Commit fe56878

Browse files
committed
Link to more detailed docs in slice::from_raw_parts_mut
1 parent 591a17d commit fe56878

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/libcore/slice/mod.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -3879,13 +3879,16 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
38793879
Repr { raw: FatPtr { data, len } }.rust
38803880
}
38813881

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

0 commit comments

Comments
 (0)