From a45d90ec23a94ffa39def3e1e1136d69f45f24ba Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Fri, 21 Aug 2020 21:35:52 +0200 Subject: [PATCH 1/3] Use intra-doc links --- library/core/src/alloc/layout.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index 7129f0f2402..0b680d3c3be 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -145,7 +145,7 @@ impl Layout { /// /// - If `T` is `Sized`, this function is always safe to call. /// - If the unsized tail of `T` is: - /// - a [slice], then the length of the slice tail must be an intialized + /// - a [`crate::slice`], then the length of the slice tail must be an intialized /// integer, and the size of the *entire value* /// (dynamic tail length + statically sized prefix) must fit in `isize`. /// - a [trait object], then the vtable part of the pointer must point @@ -158,7 +158,6 @@ impl Layout { /// [`Layout::for_value`] on a reference to an extern type tail. /// - otherwise, it is conservatively not allowed to call this function. /// - /// [slice]: ../../std/primitive.slice.html /// [trait object]: ../../book/ch17-02-trait-objects.html /// [extern type]: ../../unstable-book/language-features/extern-types.html #[unstable(feature = "layout_for_ptr", issue = "69835")] From 9785fd088253c04aeec6f9fa716d3d50748a6e37 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Fri, 21 Aug 2020 21:41:43 +0200 Subject: [PATCH 2/3] Use intra-doc links --- library/core/src/alloc/layout.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index 0b680d3c3be..95857a6c544 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -85,7 +85,7 @@ impl Layout { /// # Safety /// /// This function is unsafe as it does not verify the preconditions from - /// [`Layout::from_size_align`](#method.from_size_align). + /// [`Layout::from_size_align`]. #[stable(feature = "alloc_layout", since = "1.28.0")] #[rustc_const_stable(feature = "alloc_layout", since = "1.28.0")] #[inline] @@ -195,8 +195,7 @@ impl Layout { /// will *still* have size 16. /// /// Returns an error if the combination of `self.size()` and the given - /// `align` violates the conditions listed in - /// [`Layout::from_size_align`](#method.from_size_align). + /// `align` violates the conditions listed in [`Layout::from_size_align`]. #[stable(feature = "alloc_layout_manipulation", since = "1.44.0")] #[inline] pub fn align_to(&self, align: usize) -> Result { From 2500b6df14eacaf993a53058ff1793d1526df9a5 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Sat, 22 Aug 2020 12:16:03 +0200 Subject: [PATCH 3/3] Link to primitive instead of module --- library/core/src/alloc/layout.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs index 95857a6c544..a5ddf7619b6 100644 --- a/library/core/src/alloc/layout.rs +++ b/library/core/src/alloc/layout.rs @@ -145,7 +145,7 @@ impl Layout { /// /// - If `T` is `Sized`, this function is always safe to call. /// - If the unsized tail of `T` is: - /// - a [`crate::slice`], then the length of the slice tail must be an intialized + /// - a [slice], then the length of the slice tail must be an intialized /// integer, and the size of the *entire value* /// (dynamic tail length + statically sized prefix) must fit in `isize`. /// - a [trait object], then the vtable part of the pointer must point @@ -158,6 +158,7 @@ impl Layout { /// [`Layout::for_value`] on a reference to an extern type tail. /// - otherwise, it is conservatively not allowed to call this function. /// + /// [slice]: ../../std/primitive.slice.html /// [trait object]: ../../book/ch17-02-trait-objects.html /// [extern type]: ../../unstable-book/language-features/extern-types.html #[unstable(feature = "layout_for_ptr", issue = "69835")]