diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index d991cd722a2..70ee065c857 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -103,6 +103,11 @@ #![feature(fundamental)] #![feature(inplace_iteration)] #![feature(int_bits_const)] +// Technically, this is a bug in rustdoc: rustdoc sees the documentation on `#[lang = slice_alloc]` +// blocks is for `&[T]`, which also has documentation using this feature in `core`, and gets mad +// that the feature-gate isn't enabled. Ideally, it wouldn't check for the feature gate for docs +// from other crates, but since this can only appear for lang items, it doesn't seem worth fixing. +#![feature(intra_doc_pointers)] #![feature(lang_items)] #![feature(layout_for_ptr)] #![feature(maybe_uninit_ref)] diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index 9924f60ff77..0c911cea1bb 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -1,6 +1,6 @@ //! A dynamically-sized view into a contiguous sequence, `[T]`. //! -//! *[See also the slice primitive type](../../std/primitive.slice.html).* +//! *[See also the slice primitive type](slice).* //! //! Slices are a view into a block of memory represented as a pointer and a //! length. @@ -71,12 +71,12 @@ //! [`.chunks`], [`.windows`] and more. //! //! [`Hash`]: core::hash::Hash -//! [`.iter`]: ../../std/primitive.slice.html#method.iter -//! [`.iter_mut`]: ../../std/primitive.slice.html#method.iter_mut -//! [`.split`]: ../../std/primitive.slice.html#method.split -//! [`.splitn`]: ../../std/primitive.slice.html#method.splitn -//! [`.chunks`]: ../../std/primitive.slice.html#method.chunks -//! [`.windows`]: ../../std/primitive.slice.html#method.windows +//! [`.iter`]: slice::iter +//! [`.iter_mut`]: slice::iter_mut +//! [`.split`]: slice::split +//! [`.splitn`]: slice::splitn +//! [`.chunks`]: slice::chunks +//! [`.windows`]: slice::windows #![stable(feature = "rust1", since = "1.0.0")] // Many of the usings in this module are only used in the test configuration. // It's cleaner to just turn off the unused_imports warning than to fix them. @@ -673,7 +673,7 @@ pub fn to_ascii_lowercase(&self) -> Vec { // Extension traits for slices over specific kinds of data //////////////////////////////////////////////////////////////////////////////// -/// Helper trait for [`[T]::concat`](../../std/primitive.slice.html#method.concat). +/// Helper trait for [`[T]::concat`](slice::concat). /// /// Note: the `Item` type parameter is not used in this trait, /// but it allows impls to be more generic. @@ -708,19 +708,19 @@ pub trait Concat { /// The resulting type after concatenation type Output; - /// Implementation of [`[T]::concat`](../../std/primitive.slice.html#method.concat) + /// Implementation of [`[T]::concat`](slice::concat) #[unstable(feature = "slice_concat_trait", issue = "27747")] fn concat(slice: &Self) -> Self::Output; } -/// Helper trait for [`[T]::join`](../../std/primitive.slice.html#method.join) +/// Helper trait for [`[T]::join`](slice::join) #[unstable(feature = "slice_concat_trait", issue = "27747")] pub trait Join { #[unstable(feature = "slice_concat_trait", issue = "27747")] /// The resulting type after concatenation type Output; - /// Implementation of [`[T]::join`](../../std/primitive.slice.html#method.join) + /// Implementation of [`[T]::join`](slice::join) #[unstable(feature = "slice_concat_trait", issue = "27747")] fn join(slice: &Self, sep: Separator) -> Self::Output; } diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs index 70e0c7dba5e..8c64bc08012 100644 --- a/library/alloc/src/str.rs +++ b/library/alloc/src/str.rs @@ -1,6 +1,6 @@ //! Unicode string slices. //! -//! *[See also the `str` primitive type](../../std/primitive.str.html).* +//! *[See also the `str` primitive type](str).* //! //! The `&str` type is one of the two main string types, the other being `String`. //! Unlike its `String` counterpart, its contents are borrowed. diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 6fb3fcbb63b..b567d0a2fe2 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -495,7 +495,7 @@ pub fn from_utf8(vec: Vec) -> Result { /// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with /// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD], which looks like this: � /// - /// [byteslice]: ../../std/primitive.slice.html + /// [byteslice]: prim@slice /// [U+FFFD]: core::char::REPLACEMENT_CHARACTER /// /// If you are sure that the byte slice is valid UTF-8, and you don't want diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index b1b26194283..01a3f9f9b59 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -216,7 +216,7 @@ /// # Slicing /// /// A `Vec` can be mutable. Slices, on the other hand, are read-only objects. -/// To get a [slice], use [`&`]. Example: +/// To get a [slice][prim@slice], use [`&`]. Example: /// /// ``` /// fn read_slice(slice: &[usize]) { @@ -369,8 +369,6 @@ /// [`reserve`]: Vec::reserve /// [`MaybeUninit`]: core::mem::MaybeUninit /// [owned slice]: Box -/// [slice]: ../../std/primitive.slice.html -/// [`&`]: ../../std/primitive.reference.html #[stable(feature = "rust1", since = "1.0.0")] #[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")] pub struct Vec { @@ -2517,7 +2515,7 @@ pub fn drain_filter(&mut self, filter: F) -> DrainFilter<'_, T, F, A> /// This implementation is specialized for slice iterators, where it uses [`copy_from_slice`] to /// append the entire slice at once. /// -/// [`copy_from_slice`]: ../../std/primitive.slice.html#method.copy_from_slice +/// [`copy_from_slice`]: slice::copy_from_slice #[stable(feature = "extend_ref", since = "1.2.0")] impl<'a, T: Copy + 'a, A: Allocator + 'a> Extend<&'a T> for Vec { fn extend>(&mut self, iter: I) { 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 @@ pub fn for_value(t: &T) -> Self { /// [`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 @@ }; /// A by-value [array] iterator. -/// -/// [array]: ../../std/primitive.array.html #[stable(feature = "array_value_iter", since = "1.51.0")] pub struct IntoIter { /// 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: 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: Sized { @@ -673,8 +672,6 @@ fn as_mut(&mut self) -> &mut 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 @@ /// 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 @@ /// 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(dst: *const T, offset: isize) -> *const T; @@ -1111,8 +1110,7 @@ /// 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(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 @@ pub const fn slice_as_mut_ptr(this: &mut [MaybeUninit]) -> *mut 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], src: &[T]) -> &'a mut [T] where @@ -1037,7 +1036,6 @@ pub fn write_slice<'a>(this: &'a mut [MaybeUninit], src: &[T]) -> &'a mut [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], 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() -> 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(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(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: FnMut { /// 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: FnOnce { /// 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 @@ pub unsafe fn get_unchecked(self, index: I) -> *const I::Output /// 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]> { 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 @@ pub unsafe fn get_unchecked_mut(self, index: I) -> *mut I::Output /// 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]> { @@ -1325,8 +1323,6 @@ pub unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit]> { /// 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]> { 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 @@ pub const fn as_mut_ptr(self) -> *mut 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] { @@ -470,7 +469,6 @@ pub unsafe fn as_uninit_slice(&self) -> &[MaybeUninit] { /// 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 @@ /// /// [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 @@ /// 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 @@ /// stack-allocated string. There is an example of this in the /// examples section below. /// -/// [byteslice]: ../../std/primitive.slice.html +/// [byteslice]: slice /// /// # Errors /// diff --git a/library/std/src/ffi/c_str.rs b/library/std/src/ffi/c_str.rs index 230ef0b23db..945bfda1b78 100644 --- a/library/std/src/ffi/c_str.rs +++ b/library/std/src/ffi/c_str.rs @@ -62,20 +62,18 @@ /// u8` argument which is not necessarily nul-terminated, plus another /// argument with the length of the string — like C's `strndup()`. /// You can of course get the slice's length with its -/// [`len`][slice.len] method. +/// [`len`][slice::len] method. /// /// If you need a `&[`[`u8`]`]` slice *with* the nul terminator, you /// can use [`CString::as_bytes_with_nul`] instead. /// /// Once you have the kind of slice you need (with or without a nul /// terminator), you can call the slice's own -/// [`as_ptr`][slice.as_ptr] method to get a read-only raw pointer to pass to +/// [`as_ptr`][slice::as_ptr] method to get a read-only raw pointer to pass to /// extern functions. See the documentation for that function for a /// discussion on ensuring the lifetime of the raw pointer. /// /// [`&str`]: prim@str -/// [slice.as_ptr]: ../primitive.slice.html#method.as_ptr -/// [slice.len]: ../primitive.slice.html#method.len /// [`Deref`]: ops::Deref /// [`&CStr`]: CStr /// diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index db3b0e2628f..22914987405 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -482,7 +482,7 @@ pub(crate) fn default_read_exact(this: &mut R, mut buf: &mut [ /// } /// ``` /// -/// Read from [`&str`] because [`&[u8]`][slice] implements `Read`: +/// Read from [`&str`] because [`&[u8]`][prim@slice] implements `Read`: /// /// ```no_run /// # use std::io; @@ -504,7 +504,6 @@ pub(crate) fn default_read_exact(this: &mut R, mut buf: &mut [ /// [`&str`]: prim@str /// [`std::io`]: self /// [`File`]: crate::fs::File -/// [slice]: ../../std/primitive.slice.html #[stable(feature = "rust1", since = "1.0.0")] #[doc(spotlight)] pub trait Read { diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs index 6b06539a094..383eaf2e3a2 100644 --- a/library/std/src/keyword_docs.rs +++ b/library/std/src/keyword_docs.rs @@ -42,7 +42,7 @@ /// [Reference]: ../reference/expressions/operator-expr.html#type-cast-expressions /// [`crate`]: keyword.crate.html /// [`use`]: keyword.use.html -/// [const-cast]: primitive.pointer.html#method.cast +/// [const-cast]: pointer::cast /// [mut-cast]: primitive.pointer.html#method.cast-1 mod as_keyword {} @@ -181,9 +181,8 @@ mod break_keyword {} /// The `const` keyword is also used in raw pointers in combination with `mut`, as seen in `*const /// T` and `*mut T`. More about `const` as used in raw pointers can be read at the Rust docs for the [pointer primitive]. /// -/// [pointer primitive]: primitive.pointer.html -/// [Rust Book]: -/// ../book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants +/// [pointer primitive]: pointer +/// [Rust Book]: ../book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants /// [Reference]: ../reference/items/constant-items.html /// [const-eval]: ../reference/const_eval.html mod const_keyword {} @@ -371,7 +370,6 @@ mod else_keyword {} /// [ADT]: https://en.wikipedia.org/wiki/Algebraic_data_type /// [Rust Book]: ../book/ch06-01-defining-an-enum.html /// [Reference]: ../reference/items/enumerations.html -/// [`!`]: primitive.never.html mod enum_keyword {} #[doc(keyword = "extern")] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 32aca8c8392..2eafcdd051b 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -61,14 +61,14 @@ //! type, but not the all-important methods. //! //! So for example there is a [page for the primitive type -//! `i32`](primitive.i32.html) that lists all the methods that can be called on +//! `i32`](primitive::i32) that lists all the methods that can be called on //! 32-bit integers (very useful), and there is a [page for the module //! `std::i32`] that documents the constant values [`MIN`] and [`MAX`] (rarely //! useful). //! -//! Note the documentation for the primitives [`str`] and [`[T]`][slice] (also +//! Note the documentation for the primitives [`str`] and [`[T]`][prim@slice] (also //! called 'slice'). Many method calls on [`String`] and [`Vec`] are actually -//! calls to methods on [`str`] and [`[T]`][slice] respectively, via [deref +//! calls to methods on [`str`] and [`[T]`][prim@slice] respectively, via [deref //! coercions][deref-coercions]. //! //! Third, the standard library defines [The Rust Prelude], a small collection @@ -111,8 +111,8 @@ //! regions of memory: //! //! * [`Vec`] - A heap-allocated *vector* that is resizable at runtime. -//! * [`[T; n]`][array] - An inline *array* with a fixed size at compile time. -//! * [`[T]`][slice] - A dynamically sized *slice* into any other kind of contiguous +//! * [`[T; N]`][prim@array] - An inline *array* with a fixed size at compile time. +//! * [`[T]`][prim@slice] - A dynamically sized *slice* into any other kind of contiguous //! storage, whether heap-allocated or not. //! //! Slices can only be handled through some kind of *pointer*, and as such come @@ -275,7 +275,7 @@ #![feature(int_error_matching)] #![feature(integer_atomics)] #![feature(into_future)] -#![cfg_attr(not(bootstrap), feature(intra_doc_pointers))] +#![feature(intra_doc_pointers)] #![feature(lang_items)] #![feature(link_args)] #![feature(linkage)] diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 876b2b8a3f6..d4bb2083d00 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -468,8 +468,8 @@ mod prim_unit {} /// /// [`null`]: ptr::null /// [`null_mut`]: ptr::null_mut -/// [`is_null`]: ../std/primitive.pointer.html#method.is_null -/// [`offset`]: ../std/primitive.pointer.html#method.offset +/// [`is_null`]: pointer::is_null +/// [`offset`]: pointer::offset /// [`into_raw`]: Box::into_raw /// [`drop`]: mem::drop /// [`write`]: ptr::write @@ -564,7 +564,7 @@ mod prim_pointer {} /// move_away(roa); /// ``` /// -/// [slice]: primitive.slice.html +/// [slice]: prim@slice /// [`Debug`]: fmt::Debug /// [`Hash`]: hash::Hash /// [`Borrow`]: borrow::Borrow