From 300a0072a27f9c2d64ea63cea3b15463383683b0 Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi Date: Sun, 30 Aug 2020 15:22:27 +0800 Subject: [PATCH] Fix intra-doc path resolution problem in `library/alloc/src/slice.rs` `alloc::slice` uses `core::slice` functions, documentation are copied from there and the links as well without resolution. `crate::ptr...` cannot be resolved in `alloc::slice`, but `ptr` itself is imported in both `alloc::slice` and `core::slice`, so we used that instead. --- library/core/src/slice/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index a7c6c53722a3..7de382b366cf 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -6427,8 +6427,8 @@ unsafe impl<'a, T> TrustedRandomAccess for RChunksExactMut<'a, T> { /// } /// ``` /// -/// [valid]: crate::ptr#safety -/// [`NonNull::dangling()`]: crate::ptr::NonNull::dangling +/// [valid]: ptr#safety +/// [`NonNull::dangling()`]: ptr::NonNull::dangling /// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset #[inline] #[stable(feature = "rust1", since = "1.0.0")] @@ -6467,8 +6467,8 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] { /// * The total size `len * mem::size_of::()` of the slice must be no larger than `isize::MAX`. /// See the safety documentation of [`pointer::offset`]. /// -/// [valid]: crate::ptr#safety -/// [`NonNull::dangling()`]: crate::ptr::NonNull::dangling +/// [valid]: ptr#safety +/// [`NonNull::dangling()`]: ptr::NonNull::dangling /// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset #[inline] #[stable(feature = "rust1", since = "1.0.0")]