From c8a372ecff373e8753da97d10a21e16bd853fb76 Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Sat, 22 Aug 2020 22:15:17 +0200 Subject: [PATCH] Use intra-doc-links in `core::{raw, ffi, pin}` --- library/core/src/ffi.rs | 2 -- library/core/src/pin.rs | 45 +++++++++++++---------------------------- library/core/src/raw.rs | 2 +- 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/library/core/src/ffi.rs b/library/core/src/ffi.rs index e9689af39d51f..4525ba78ba095 100644 --- a/library/core/src/ffi.rs +++ b/library/core/src/ffi.rs @@ -281,8 +281,6 @@ impl<'a, 'f: 'a> DerefMut for VaList<'a, 'f> { // improving this. mod sealed_trait { /// Trait which permits the allowed types to be used with [VaList::arg]. - /// - /// [VaList::arg]: ../struct.VaList.html#method.arg #[unstable( feature = "c_variadic", reason = "the `c_variadic` feature has not been properly tested on \ diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs index b63219a440392..290aa797fd964 100644 --- a/library/core/src/pin.rs +++ b/library/core/src/pin.rs @@ -349,37 +349,28 @@ //! mutable reference even when you just have [`Pin`]`<&mut Self>` (such as in your own //! [`poll`] implementation). //! -//! [`Pin

`]: struct.Pin.html -//! [`Unpin`]: ../marker/trait.Unpin.html -//! [`Deref`]: ../ops/trait.Deref.html -//! [`DerefMut`]: ../ops/trait.DerefMut.html -//! [`mem::swap`]: ../mem/fn.swap.html -//! [`mem::forget`]: ../mem/fn.forget.html +//! [`Pin

`]: Pin +//! [`Deref`]: crate::ops::Deref +//! [`DerefMut`]: crate::ops::DerefMut +//! [`mem::swap`]: crate::mem::swap +//! [`mem::forget`]: crate::mem::forget //! [`Box`]: ../../std/boxed/struct.Box.html //! [`Vec`]: ../../std/vec/struct.Vec.html //! [`Vec::set_len`]: ../../std/vec/struct.Vec.html#method.set_len -//! [`Pin`]: struct.Pin.html //! [`Box`]: ../../std/boxed/struct.Box.html //! [Vec::pop]: ../../std/vec/struct.Vec.html#method.pop //! [Vec::push]: ../../std/vec/struct.Vec.html#method.push //! [`Rc`]: ../../std/rc/struct.Rc.html -//! [`RefCell`]: ../../std/cell/struct.RefCell.html -//! [`Drop`]: ../../std/ops/trait.Drop.html -//! [`drop`]: ../../std/ops/trait.Drop.html#tymethod.drop +//! [`RefCell`]: crate::cell::RefCell +//! [`drop`]: Drop::drop //! [`VecDeque`]: ../../std/collections/struct.VecDeque.html -//! [`Option`]: ../../std/option/enum.Option.html -//! [`VecDeque`]: ../../std/collections/struct.VecDeque.html -//! [`RefCell`]: ../cell/struct.RefCell.html -//! [`None`]: ../option/enum.Option.html#variant.None -//! [`Some(v)`]: ../option/enum.Option.html#variant.Some -//! [`ptr::write`]: ../ptr/fn.write.html -//! [`Future`]: ../future/trait.Future.html +//! [`Option`]: Option +//! [`Some(v)`]: Some +//! [`ptr::write`]: crate::ptr::write +//! [`Future`]: crate::future::Future //! [drop-impl]: #drop-implementation //! [drop-guarantee]: #drop-guarantee -//! [`poll`]: ../../std/future/trait.Future.html#tymethod.poll -//! [`Pin::get_unchecked_mut`]: struct.Pin.html#method.get_unchecked_mut -//! [`bool`]: ../../std/primitive.bool.html -//! [`i32`]: ../../std/primitive.i32.html +//! [`poll`]: crate::future::Future::poll #![stable(feature = "pin", since = "1.33.0")] @@ -397,8 +388,7 @@ use crate::ops::{CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Receiver}; /// /// *See the [`pin` module] documentation for an explanation of pinning.* /// -/// [`Unpin`]: ../../std/marker/trait.Unpin.html -/// [`pin` module]: ../../std/pin/index.html +/// [`pin` module]: self // // Note: the `Clone` derive below causes unsoundness as it's possible to implement // `Clone` for mutable references. @@ -481,8 +471,6 @@ impl> Pin

{ /// /// Unlike `Pin::new_unchecked`, this method is safe because the pointer /// `P` dereferences to an [`Unpin`] type, which cancels the pinning guarantees. - /// - /// [`Unpin`]: ../../std/marker/trait.Unpin.html #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] pub fn new(pointer: P) -> Pin

{ @@ -495,8 +483,6 @@ impl> Pin

{ /// /// This requires that the data inside this `Pin` is [`Unpin`] so that we /// can ignore the pinning invariants when unwrapping it. - /// - /// [`Unpin`]: ../../std/marker/trait.Unpin.html #[stable(feature = "pin_into_inner", since = "1.39.0")] #[inline(always)] pub fn into_inner(pin: Pin

) -> P { @@ -568,7 +554,7 @@ impl Pin

{ /// } /// ``` /// - /// [`mem::swap`]: ../../std/mem/fn.swap.html + /// [`mem::swap`]: crate::mem::swap #[cfg_attr(not(bootstrap), lang = "new_unchecked")] #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] @@ -603,9 +589,6 @@ impl Pin

{ /// /// If the underlying data is [`Unpin`], [`Pin::into_inner`] should be used /// instead. - /// - /// [`Unpin`]: ../../std/marker/trait.Unpin.html - /// [`Pin::into_inner`]: #method.into_inner #[stable(feature = "pin_into_inner", since = "1.39.0")] #[inline(always)] pub unsafe fn into_inner_unchecked(pin: Pin

) -> P { diff --git a/library/core/src/raw.rs b/library/core/src/raw.rs index 741a9dc8797be..1227d9b01f011 100644 --- a/library/core/src/raw.rs +++ b/library/core/src/raw.rs @@ -26,7 +26,7 @@ /// [`std::mem::transmute`][transmute]. Similarly, the only way to create a true /// trait object from a `TraitObject` value is with `transmute`. /// -/// [transmute]: ../intrinsics/fn.transmute.html +/// [transmute]: crate::intrinsics::transmute /// /// Synthesizing a trait object with mismatched types—one where the /// vtable does not correspond to the type of the value to which the