about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-12-19 08:23:59 -0500
committerJoshua Nelson <jyn514@gmail.com>2021-02-25 20:31:53 -0500
commit9a75f4fed10a65e6cb779fc059f272deadd7ecc1 (patch)
tree39313a495c8f8513f87f7891b1d9bbceb723cc53 /library/core/src
parentc0a54cc4eb6111cac9ad75cc439f75b79698b4a7 (diff)
downloadrust-9a75f4fed10a65e6cb779fc059f272deadd7ecc1.tar.gz
rust-9a75f4fed10a65e6cb779fc059f272deadd7ecc1.zip
Convert primitives to use intra-doc links
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/alloc/layout.rs1
-rw-r--r--library/core/src/array/iter.rs2
-rw-r--r--library/core/src/array/mod.rs2
-rw-r--r--library/core/src/convert/mod.rs3
-rw-r--r--library/core/src/ffi.rs1
-rw-r--r--library/core/src/intrinsics.rs6
-rw-r--r--library/core/src/lib.rs2
-rw-r--r--library/core/src/mem/maybe_uninit.rs2
-rw-r--r--library/core/src/mem/mod.rs3
-rw-r--r--library/core/src/ops/function.rs6
-rw-r--r--library/core/src/ptr/const_ptr.rs2
-rw-r--r--library/core/src/ptr/mod.rs4
-rw-r--r--library/core/src/ptr/mut_ptr.rs4
-rw-r--r--library/core/src/ptr/non_null.rs2
-rw-r--r--library/core/src/slice/raw.rs2
-rw-r--r--library/core/src/str/converts.rs4
16 files changed, 11 insertions, 35 deletions
diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs
index 9dc3f05dae5..8b95b70396b 100644
--- a/library/core/src/alloc/layout.rs
+++ b/library/core/src/alloc/layout.rs
@@ -164,7 +164,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")]
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index 535291471b1..4472fba26b9 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -9,8 +9,6 @@ use crate::{
 };
 
 /// A by-value [array] iterator.
-///
-/// [array]: ../../std/primitive.array.html
 #[stable(feature = "array_value_iter", since = "1.51.0")]
 pub struct IntoIter<T, const N: usize> {
     /// This is the array we are iterating over.
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs
index d4fd7545d9b..20251edf6f7 100644
--- a/library/core/src/array/mod.rs
+++ b/library/core/src/array/mod.rs
@@ -2,7 +2,7 @@
 //! up to a certain length. Eventually, we should be able to generalize
 //! to all lengths.
 //!
-//! *[See also the array primitive type](../../std/primitive.array.html).*
+//! *[See also the array primitive type](array).*
 
 #![stable(feature = "core_array", since = "1.36.0")]
 
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs
index e1b19e4b73c..65af8508a68 100644
--- a/library/core/src/convert/mod.rs
+++ b/library/core/src/convert/mod.rs
@@ -463,7 +463,6 @@ pub trait TryInto<T>: Sized {
 /// ```
 ///
 /// [`try_from`]: TryFrom::try_from
-/// [`!`]: ../../std/primitive.never.html
 #[rustc_diagnostic_item = "try_from_trait"]
 #[stable(feature = "try_from", since = "1.34.0")]
 pub trait TryFrom<T>: Sized {
@@ -673,8 +672,6 @@ impl AsMut<str> for str {
 /// However when `Infallible` becomes an alias for the never type,
 /// the two `impl`s will start to overlap
 /// and therefore will be disallowed by the language’s trait coherence rules.
-///
-/// [never]: ../../std/primitive.never.html
 #[stable(feature = "convert_infallible", since = "1.34.0")]
 #[derive(Copy)]
 pub enum Infallible {}
diff --git a/library/core/src/ffi.rs b/library/core/src/ffi.rs
index 4b303acfd3b..9302baa823b 100644
--- a/library/core/src/ffi.rs
+++ b/library/core/src/ffi.rs
@@ -21,7 +21,6 @@ use crate::ops::{Deref, DerefMut};
 /// compiler down to 1.1.0. After Rust 1.30.0, it was re-exported by
 /// this definition. For more information, please read [RFC 2521].
 ///
-/// [pointer]: ../../std/primitive.pointer.html
 /// [Nomicon]: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs
 /// [RFC 2521]: https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md
 // N.B., for LLVM to recognize the void pointer type and by extension
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index 5274262ded2..afea8aa8ff2 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -1093,8 +1093,7 @@ extern "rust-intrinsic" {
     /// bounds or arithmetic overflow occurs then any further use of the
     /// returned value will result in undefined behavior.
     ///
-    /// The stabilized version of this intrinsic is
-    /// [`std::pointer::offset`](../../std/primitive.pointer.html#method.offset).
+    /// The stabilized version of this intrinsic is [`pointer::offset`].
     #[must_use = "returns a new pointer rather than modifying its argument"]
     #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")]
     pub fn offset<T>(dst: *const T, offset: isize) -> *const T;
@@ -1111,8 +1110,7 @@ extern "rust-intrinsic" {
     /// object, and it wraps with two's complement arithmetic. The resulting
     /// value is not necessarily valid to be used to actually access memory.
     ///
-    /// The stabilized version of this intrinsic is
-    /// [`std::pointer::wrapping_offset`](../../std/primitive.pointer.html#method.wrapping_offset).
+    /// The stabilized version of this intrinsic is [`pointer::wrapping_offset`].
     #[must_use = "returns a new pointer rather than modifying its argument"]
     #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")]
     pub fn arith_offset<T>(dst: *const T, offset: isize) -> *const T;
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 64e2a951309..c50d9507a17 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -114,7 +114,7 @@
 #![feature(extended_key_value_attributes)]
 #![feature(extern_types)]
 #![feature(fundamental)]
-#![cfg_attr(not(bootstrap), feature(intra_doc_pointers))]
+#![feature(intra_doc_pointers)]
 #![feature(intrinsics)]
 #![feature(lang_items)]
 #![feature(link_llvm_intrinsics)]
diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs
index 3760f5c4794..26314213ff7 100644
--- a/library/core/src/mem/maybe_uninit.rs
+++ b/library/core/src/mem/maybe_uninit.rs
@@ -976,7 +976,6 @@ impl<T> MaybeUninit<T> {
     /// ```
     ///
     /// [`write_slice_cloned`]: MaybeUninit::write_slice_cloned
-    /// [`slice::copy_from_slice`]: ../../std/primitive.slice.html#method.copy_from_slice
     #[unstable(feature = "maybe_uninit_write_slice", issue = "79995")]
     pub fn write_slice<'a>(this: &'a mut [MaybeUninit<T>], src: &[T]) -> &'a mut [T]
     where
@@ -1037,7 +1036,6 @@ impl<T> MaybeUninit<T> {
     /// ```
     ///
     /// [`write_slice`]: MaybeUninit::write_slice
-    /// [`slice::clone_from_slice`]: ../../std/primitive.slice.html#method.clone_from_slice
     #[unstable(feature = "maybe_uninit_write_slice", issue = "79995")]
     pub fn write_slice_cloned<'a>(this: &'a mut [MaybeUninit<T>], src: &[T]) -> &'a mut [T]
     where
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs
index 87890f92759..afce6e55b8f 100644
--- a/library/core/src/mem/mod.rs
+++ b/library/core/src/mem/mod.rs
@@ -308,7 +308,6 @@ pub const fn size_of<T>() -> usize {
 /// statically-known size, e.g., a slice [`[T]`][slice] or a [trait object],
 /// then `size_of_val` can be used to get the dynamically-known size.
 ///
-/// [slice]: ../../std/primitive.slice.html
 /// [trait object]: ../../book/ch17-02-trait-objects.html
 ///
 /// # Examples
@@ -355,7 +354,6 @@ pub const fn size_of_val<T: ?Sized>(val: &T) -> usize {
 ///       [`size_of_val`] on a reference to a type with 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
 ///
@@ -494,7 +492,6 @@ pub const fn align_of_val<T: ?Sized>(val: &T) -> usize {
 ///       [`align_of_val`] on a reference to a type with 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
 ///
diff --git a/library/core/src/ops/function.rs b/library/core/src/ops/function.rs
index bfdec43f7d8..e5c4798afcb 100644
--- a/library/core/src/ops/function.rs
+++ b/library/core/src/ops/function.rs
@@ -28,7 +28,7 @@
 /// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
 ///
 /// [book]: ../../book/ch13-01-closures.html
-/// [function pointers]: ../../std/primitive.fn.html
+/// [function pointers]: fn
 /// [nomicon]: ../../nomicon/hrtb.html
 ///
 /// # Examples
@@ -97,7 +97,7 @@ pub trait Fn<Args>: FnMut<Args> {
 /// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
 ///
 /// [book]: ../../book/ch13-01-closures.html
-/// [function pointers]: ../../std/primitive.fn.html
+/// [function pointers]: fn
 /// [nomicon]: ../../nomicon/hrtb.html
 ///
 /// # Examples
@@ -176,7 +176,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
 /// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
 ///
 /// [book]: ../../book/ch13-01-closures.html
-/// [function pointers]: ../../std/primitive.fn.html
+/// [function pointers]: fn
 /// [nomicon]: ../../nomicon/hrtb.html
 ///
 /// # Examples
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index ddff0ff67de..cfc1bfd54be 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -1011,8 +1011,6 @@ impl<T> *const [T] {
     /// See also [`slice::from_raw_parts`][].
     ///
     /// [valid]: crate::ptr#safety
-    /// [`NonNull::dangling()`]: NonNull::dangling
-    /// [`pointer::offset`]: ../std/primitive.pointer.html#method.offset
     #[inline]
     #[unstable(feature = "ptr_as_uninit", issue = "75402")]
     pub unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]> {
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 481d5d772b4..5026c48bdf4 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -1,6 +1,6 @@
 //! Manually manage memory through raw pointers.
 //!
-//! *[See also the pointer primitive types](../../std/primitive.pointer.html).*
+//! *[See also the pointer primitive types](pointer).*
 //!
 //! # Safety
 //!
@@ -60,7 +60,7 @@
 //! [ub]: ../../reference/behavior-considered-undefined.html
 //! [zst]: ../../nomicon/exotic-sizes.html#zero-sized-types-zsts
 //! [atomic operations]: crate::sync::atomic
-//! [`offset`]: ../../std/primitive.pointer.html#method.offset
+//! [`offset`]: pointer::offset
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index 4e3e88b946c..06bacc86351 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -1273,8 +1273,6 @@ impl<T> *mut [T] {
     /// See also [`slice::from_raw_parts`][].
     ///
     /// [valid]: crate::ptr#safety
-    /// [`NonNull::dangling()`]: NonNull::dangling
-    /// [`pointer::offset`]: ../std/primitive.pointer.html#method.offset
     #[inline]
     #[unstable(feature = "ptr_as_uninit", issue = "75402")]
     pub unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]> {
@@ -1325,8 +1323,6 @@ impl<T> *mut [T] {
     /// See also [`slice::from_raw_parts_mut`][].
     ///
     /// [valid]: crate::ptr#safety
-    /// [`NonNull::dangling()`]: NonNull::dangling
-    /// [`pointer::offset`]: ../std/primitive.pointer.html#method.offset
     #[inline]
     #[unstable(feature = "ptr_as_uninit", issue = "75402")]
     pub unsafe fn as_uninit_slice_mut<'a>(self) -> Option<&'a mut [MaybeUninit<T>]> {
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index 709c247f296..8d533cd6be1 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -425,7 +425,6 @@ impl<T> NonNull<[T]> {
     /// See also [`slice::from_raw_parts`].
     ///
     /// [valid]: crate::ptr#safety
-    /// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset
     #[inline]
     #[unstable(feature = "ptr_as_uninit", issue = "75402")]
     pub unsafe fn as_uninit_slice(&self) -> &[MaybeUninit<T>] {
@@ -470,7 +469,6 @@ impl<T> NonNull<[T]> {
     /// See also [`slice::from_raw_parts_mut`].
     ///
     /// [valid]: crate::ptr#safety
-    /// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset
     ///
     /// # Examples
     ///
diff --git a/library/core/src/slice/raw.rs b/library/core/src/slice/raw.rs
index 117db6e3e3b..eda50dc287f 100644
--- a/library/core/src/slice/raw.rs
+++ b/library/core/src/slice/raw.rs
@@ -83,7 +83,6 @@ use crate::ptr;
 ///
 /// [valid]: ptr#safety
 /// [`NonNull::dangling()`]: ptr::NonNull::dangling
-/// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
@@ -125,7 +124,6 @@ pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
 ///
 /// [valid]: ptr#safety
 /// [`NonNull::dangling()`]: ptr::NonNull::dangling
-/// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset
 #[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] {
diff --git a/library/core/src/str/converts.rs b/library/core/src/str/converts.rs
index 73316433e09..05ff7bb120d 100644
--- a/library/core/src/str/converts.rs
+++ b/library/core/src/str/converts.rs
@@ -14,7 +14,7 @@ use super::Utf8Error;
 /// UTF-8, and then does the conversion.
 ///
 /// [`&str`]: str
-/// [byteslice]: ../../std/primitive.slice.html
+/// [byteslice]: slice
 ///
 /// If you are sure that the byte slice is valid UTF-8, and you don't want to
 /// incur the overhead of the validity check, there is an unsafe version of
@@ -31,7 +31,7 @@ use super::Utf8Error;
 /// stack-allocated string. There is an example of this in the
 /// examples section below.
 ///
-/// [byteslice]: ../../std/primitive.slice.html
+/// [byteslice]: slice
 ///
 /// # Errors
 ///