Skip to content

Commit

Permalink
Convert the rest of the standard library primitives to intra-doc links
Browse files Browse the repository at this point in the history
Note that float methods in `core::intrinsics` weren't converted because
they are only defined in `std` (using language item hacks).
  • Loading branch information
jyn514 committed Feb 26, 2021
1 parent 9a75f4f commit 4d46735
Show file tree
Hide file tree
Showing 21 changed files with 128 additions and 138 deletions.
3 changes: 1 addition & 2 deletions library/core/src/char/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
//! [Unicode code point]: http://www.unicode.org/glossary/#code_point
//!
//! This module exists for technical reasons, the primary documentation for
//! `char` is directly on [the `char` primitive type](../../std/primitive.char.html)
//! itself.
//! `char` is directly on [the `char` primitive type][char] itself.
//!
//! This module is the home of the iterator implementations for the iterators
//! implemented on `char`, as well as some useful constants and conversion
Expand Down
28 changes: 14 additions & 14 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants specific to the `f32` single-precision floating point type.
//!
//! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
//! *[See also the `f32` primitive type][f32].*
//!
//! Mathematically significant numbers are provided in the `consts` sub-module.
//!
Expand Down Expand Up @@ -35,7 +35,7 @@ use crate::num::FpCategory;
pub const RADIX: u32 = f32::RADIX;

/// Number of significant digits in base 2.
/// Use [`f32::MANTISSA_DIGITS`](../../std/primitive.f32.html#associatedconstant.MANTISSA_DIGITS) instead.
/// Use [`f32::MANTISSA_DIGITS`] instead.
///
/// # Examples
///
Expand All @@ -55,7 +55,7 @@ pub const RADIX: u32 = f32::RADIX;
pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;

/// Approximate number of significant digits in base 10.
/// Use [`f32::DIGITS`](../../std/primitive.f32.html#associatedconstant.DIGITS) instead.
/// Use [`f32::DIGITS`] instead.
///
/// # Examples
///
Expand All @@ -72,7 +72,7 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
pub const DIGITS: u32 = f32::DIGITS;

/// [Machine epsilon] value for `f32`.
/// Use [`f32::EPSILON`](../../std/primitive.f32.html#associatedconstant.EPSILON) instead.
/// Use [`f32::EPSILON`] instead.
///
/// This is the difference between `1.0` and the next larger representable number.
///
Expand All @@ -96,7 +96,7 @@ pub const DIGITS: u32 = f32::DIGITS;
pub const EPSILON: f32 = f32::EPSILON;

/// Smallest finite `f32` value.
/// Use [`f32::MIN`](../../std/primitive.f32.html#associatedconstant.MIN) instead.
/// Use [`f32::MIN`] instead.
///
/// # Examples
///
Expand All @@ -113,7 +113,7 @@ pub const EPSILON: f32 = f32::EPSILON;
pub const MIN: f32 = f32::MIN;

/// Smallest positive normal `f32` value.
/// Use [`f32::MIN_POSITIVE`](../../std/primitive.f32.html#associatedconstant.MIN_POSITIVE) instead.
/// Use [`f32::MIN_POSITIVE`] instead.
///
/// # Examples
///
Expand All @@ -133,7 +133,7 @@ pub const MIN: f32 = f32::MIN;
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;

/// Largest finite `f32` value.
/// Use [`f32::MAX`](../../std/primitive.f32.html#associatedconstant.MAX) instead.
/// Use [`f32::MAX`] instead.
///
/// # Examples
///
Expand All @@ -150,7 +150,7 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
pub const MAX: f32 = f32::MAX;

/// One greater than the minimum possible normal power of 2 exponent.
/// Use [`f32::MIN_EXP`](../../std/primitive.f32.html#associatedconstant.MIN_EXP) instead.
/// Use [`f32::MIN_EXP`] instead.
///
/// # Examples
///
Expand All @@ -170,7 +170,7 @@ pub const MAX: f32 = f32::MAX;
pub const MIN_EXP: i32 = f32::MIN_EXP;

/// Maximum possible power of 2 exponent.
/// Use [`f32::MAX_EXP`](../../std/primitive.f32.html#associatedconstant.MAX_EXP) instead.
/// Use [`f32::MAX_EXP`] instead.
///
/// # Examples
///
Expand All @@ -190,7 +190,7 @@ pub const MIN_EXP: i32 = f32::MIN_EXP;
pub const MAX_EXP: i32 = f32::MAX_EXP;

/// Minimum possible normal power of 10 exponent.
/// Use [`f32::MIN_10_EXP`](../../std/primitive.f32.html#associatedconstant.MIN_10_EXP) instead.
/// Use [`f32::MIN_10_EXP`] instead.
///
/// # Examples
///
Expand All @@ -210,7 +210,7 @@ pub const MAX_EXP: i32 = f32::MAX_EXP;
pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;

/// Maximum possible power of 10 exponent.
/// Use [`f32::MAX_10_EXP`](../../std/primitive.f32.html#associatedconstant.MAX_10_EXP) instead.
/// Use [`f32::MAX_10_EXP`] instead.
///
/// # Examples
///
Expand All @@ -230,7 +230,7 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;

/// Not a Number (NaN).
/// Use [`f32::NAN`](../../std/primitive.f32.html#associatedconstant.NAN) instead.
/// Use [`f32::NAN`] instead.
///
/// # Examples
///
Expand All @@ -247,7 +247,7 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
pub const NAN: f32 = f32::NAN;

/// Infinity (∞).
/// Use [`f32::INFINITY`](../../std/primitive.f32.html#associatedconstant.INFINITY) instead.
/// Use [`f32::INFINITY`] instead.
///
/// # Examples
///
Expand All @@ -267,7 +267,7 @@ pub const NAN: f32 = f32::NAN;
pub const INFINITY: f32 = f32::INFINITY;

/// Negative infinity (−∞).
/// Use [`f32::NEG_INFINITY`](../../std/primitive.f32.html#associatedconstant.NEG_INFINITY) instead.
/// Use [`f32::NEG_INFINITY`] instead.
///
/// # Examples
///
Expand Down
30 changes: 15 additions & 15 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants specific to the `f64` double-precision floating point type.
//!
//! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
//! *[See also the `f64` primitive type][f64].*
//!
//! Mathematically significant numbers are provided in the `consts` sub-module.
//!
Expand All @@ -18,7 +18,7 @@ use crate::mem;
use crate::num::FpCategory;

/// The radix or base of the internal representation of `f64`.
/// Use [`f64::RADIX`](../../std/primitive.f64.html#associatedconstant.RADIX) instead.
/// Use [`f64::RADIX`] instead.
///
/// # Examples
///
Expand All @@ -35,7 +35,7 @@ use crate::num::FpCategory;
pub const RADIX: u32 = f64::RADIX;

/// Number of significant digits in base 2.
/// Use [`f64::MANTISSA_DIGITS`](../../std/primitive.f64.html#associatedconstant.MANTISSA_DIGITS) instead.
/// Use [`f64::MANTISSA_DIGITS`] instead.
///
/// # Examples
///
Expand All @@ -55,7 +55,7 @@ pub const RADIX: u32 = f64::RADIX;
pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;

/// Approximate number of significant digits in base 10.
/// Use [`f64::DIGITS`](../../std/primitive.f64.html#associatedconstant.DIGITS) instead.
/// Use [`f64::DIGITS`] instead.
///
/// # Examples
///
Expand All @@ -72,7 +72,7 @@ pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
pub const DIGITS: u32 = f64::DIGITS;

/// [Machine epsilon] value for `f64`.
/// Use [`f64::EPSILON`](../../std/primitive.f64.html#associatedconstant.EPSILON) instead.
/// Use [`f64::EPSILON`] instead.
///
/// This is the difference between `1.0` and the next larger representable number.
///
Expand All @@ -96,7 +96,7 @@ pub const DIGITS: u32 = f64::DIGITS;
pub const EPSILON: f64 = f64::EPSILON;

/// Smallest finite `f64` value.
/// Use [`f64::MIN`](../../std/primitive.f64.html#associatedconstant.MIN) instead.
/// Use [`f64::MIN`] instead.
///
/// # Examples
///
Expand All @@ -113,7 +113,7 @@ pub const EPSILON: f64 = f64::EPSILON;
pub const MIN: f64 = f64::MIN;

/// Smallest positive normal `f64` value.
/// Use [`f64::MIN_POSITIVE`](../../std/primitive.f64.html#associatedconstant.MIN_POSITIVE) instead.
/// Use [`f64::MIN_POSITIVE`] instead.
///
/// # Examples
///
Expand All @@ -133,7 +133,7 @@ pub const MIN: f64 = f64::MIN;
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;

/// Largest finite `f64` value.
/// Use [`f64::MAX`](../../std/primitive.f64.html#associatedconstant.MAX) instead.
/// Use [`f64::MAX`] instead.
///
/// # Examples
///
Expand All @@ -150,7 +150,7 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
pub const MAX: f64 = f64::MAX;

/// One greater than the minimum possible normal power of 2 exponent.
/// Use [`f64::MIN_EXP`](../../std/primitive.f64.html#associatedconstant.MIN_EXP) instead.
/// Use [`f64::MIN_EXP`] instead.
///
/// # Examples
///
Expand All @@ -170,7 +170,7 @@ pub const MAX: f64 = f64::MAX;
pub const MIN_EXP: i32 = f64::MIN_EXP;

/// Maximum possible power of 2 exponent.
/// Use [`f64::MAX_EXP`](../../std/primitive.f64.html#associatedconstant.MAX_EXP) instead.
/// Use [`f64::MAX_EXP`] instead.
///
/// # Examples
///
Expand All @@ -190,7 +190,7 @@ pub const MIN_EXP: i32 = f64::MIN_EXP;
pub const MAX_EXP: i32 = f64::MAX_EXP;

/// Minimum possible normal power of 10 exponent.
/// Use [`f64::MIN_10_EXP`](../../std/primitive.f64.html#associatedconstant.MIN_10_EXP) instead.
/// Use [`f64::MIN_10_EXP`] instead.
///
/// # Examples
///
Expand All @@ -210,7 +210,7 @@ pub const MAX_EXP: i32 = f64::MAX_EXP;
pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;

/// Maximum possible power of 10 exponent.
/// Use [`f64::MAX_10_EXP`](../../std/primitive.f64.html#associatedconstant.MAX_10_EXP) instead.
/// Use [`f64::MAX_10_EXP`] instead.
///
/// # Examples
///
Expand All @@ -230,7 +230,7 @@ pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;

/// Not a Number (NaN).
/// Use [`f64::NAN`](../../std/primitive.f64.html#associatedconstant.NAN) instead.
/// Use [`f64::NAN`] instead.
///
/// # Examples
///
Expand All @@ -247,7 +247,7 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
pub const NAN: f64 = f64::NAN;

/// Infinity (∞).
/// Use [`f64::INFINITY`](../../std/primitive.f64.html#associatedconstant.INFINITY) instead.
/// Use [`f64::INFINITY`] instead.
///
/// # Examples
///
Expand All @@ -267,7 +267,7 @@ pub const NAN: f64 = f64::NAN;
pub const INFINITY: f64 = f64::INFINITY;

/// Negative infinity (−∞).
/// Use [`f64::NEG_INFINITY`](../../std/primitive.f64.html#associatedconstant.NEG_INFINITY) instead.
/// Use [`f64::NEG_INFINITY`] instead.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i128.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 128-bit signed integer type.
//!
//! *[See also the `i128` primitive type](../../std/primitive.i128.html).*
//! *[See also the `i128` primitive type][i128].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i16.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 16-bit signed integer type.
//!
//! *[See also the `i16` primitive type](../../std/primitive.i16.html).*
//! *[See also the `i16` primitive type][i16].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 32-bit signed integer type.
//!
//! *[See also the `i32` primitive type](../../std/primitive.i32.html).*
//! *[See also the `i32` primitive type][i32].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i64.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 64-bit signed integer type.
//!
//! *[See also the `i64` primitive type](../../std/primitive.i64.html).*
//! *[See also the `i64` primitive type][i64].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i8.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 8-bit signed integer type.
//!
//! *[See also the `i8` primitive type](../../std/primitive.i8.html).*
//! *[See also the `i8` primitive type][i8].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
6 changes: 2 additions & 4 deletions library/core/src/num/shells/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ macro_rules! int_module {
($T:ident, #[$attr:meta]) => (
#[doc = concat!(
"The smallest value that can be represented by this integer type. Use ",
"[`", stringify!($T), "::MIN", "`](../../std/primitive.", stringify!($T), ".html#associatedconstant.MIN)",
" instead.",
"[`", stringify!($T), "::MIN", "`] instead."
)]
///
/// # Examples
Expand All @@ -25,8 +24,7 @@ macro_rules! int_module {

#[doc = concat!(
"The largest value that can be represented by this integer type. Use ",
"[`", stringify!($T), "::MAX", "`](../../std/primitive.", stringify!($T), ".html#associatedconstant.MAX)",
" instead.",
"[`", stringify!($T), "::MAX", "`] instead."
)]
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/isize.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the pointer-sized signed integer type.
//!
//! *[See also the `isize` primitive type](../../std/primitive.isize.html).*
//! *[See also the `isize` primitive type][isize].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u128.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 128-bit unsigned integer type.
//!
//! *[See also the `u128` primitive type](../../std/primitive.u128.html).*
//! *[See also the `u128` primitive type][u128].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u16.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 16-bit unsigned integer type.
//!
//! *[See also the `u16` primitive type](../../std/primitive.u16.html).*
//! *[See also the `u16` primitive type][u16].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 32-bit unsigned integer type.
//!
//! *[See also the `u32` primitive type](../../std/primitive.u32.html).*
//! *[See also the `u32` primitive type][u32].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u64.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 64-bit unsigned integer type.
//!
//! *[See also the `u64` primitive type](../../std/primitive.u64.html).*
//! *[See also the `u64` primitive type][u64].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u8.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the 8-bit unsigned integer type.
//!
//! *[See also the `u8` primitive type](../../std/primitive.u8.html).*
//! *[See also the `u8` primitive type][u8].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/usize.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Constants for the pointer-sized unsigned integer type.
//!
//! *[See also the `usize` primitive type](../../std/primitive.usize.html).*
//! *[See also the `usize` primitive type][usize].*
//!
//! New code should use the associated constants directly on the primitive type.

Expand Down
3 changes: 1 addition & 2 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,11 +1285,10 @@ impl<T> Result<T, T> {
/// `Err`.
///
/// This can be useful in conjunction with APIs such as
/// [`Atomic*::compare_exchange`], or [`slice::binary_search`][binary_search], but only in
/// [`Atomic*::compare_exchange`], or [`slice::binary_search`], but only in
/// cases where you don't care if the result was `Ok` or not.
///
/// [`Atomic*::compare_exchange`]: crate::sync::atomic::AtomicBool::compare_exchange
/// [binary_search]: ../../std/primitive.slice.html#method.binary_search
///
/// # Examples
///
Expand Down
Loading

0 comments on commit 4d46735

Please sign in to comment.