Convert core/num/mod.rs to intra-doc links

This commit is contained in:
Joshua Nelson 2020-08-22 11:00:40 -04:00
parent 446d4533e8
commit 2179313dcf
6 changed files with 33 additions and 41 deletions

View File

@ -56,9 +56,6 @@ fn from(never: !) -> TryFromIntError {
/// in the string e.g., when it is obtained from the standard input. /// in the string e.g., when it is obtained from the standard input.
/// Using the [`str.trim()`] method ensures that no whitespace remains before parsing. /// Using the [`str.trim()`] method ensures that no whitespace remains before parsing.
/// ///
/// [`str.trim()`]: ../../std/primitive.str.html#method.trim
/// [`i8::from_str_radix`]: ../../std/primitive.i8.html#method.from_str_radix
///
/// # Example /// # Example
/// ///
/// ``` /// ```

View File

@ -18,7 +18,7 @@
use crate::num::FpCategory; use crate::num::FpCategory;
/// The radix or base of the internal representation of `f32`. /// The radix or base of the internal representation of `f32`.
/// Use [`f32::RADIX`](../../std/primitive.f32.html#associatedconstant.RADIX) instead. /// Use [`f32::RADIX`] instead.
/// ///
/// # Examples /// # Examples
/// ///
@ -832,8 +832,8 @@ pub const fn from_bits(v: u32) -> Self {
/// As the target platform's native endianness is used, portable code /// As the target platform's native endianness is used, portable code
/// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead. /// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead.
/// ///
/// [`to_be_bytes`]: #method.to_be_bytes /// [`to_be_bytes`]: f32::to_be_bytes
/// [`to_le_bytes`]: #method.to_le_bytes /// [`to_le_bytes`]: f32::to_le_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -860,7 +860,7 @@ pub const fn from_bits(v: u32) -> Self {
/// ///
/// [`to_ne_bytes`] should be preferred over this whenever possible. /// [`to_ne_bytes`] should be preferred over this whenever possible.
/// ///
/// [`to_ne_bytes`]: #method.to_ne_bytes /// [`to_ne_bytes`]: f32::to_ne_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -920,8 +920,8 @@ pub const fn from_bits(v: u32) -> Self {
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
/// appropriate instead. /// appropriate instead.
/// ///
/// [`from_be_bytes`]: #method.from_be_bytes /// [`from_be_bytes`]: f32::from_be_bytes
/// [`from_le_bytes`]: #method.from_le_bytes /// [`from_le_bytes`]: f32::from_le_bytes
/// ///
/// # Examples /// # Examples
/// ///

View File

@ -846,8 +846,8 @@ pub const fn from_bits(v: u64) -> Self {
/// As the target platform's native endianness is used, portable code /// As the target platform's native endianness is used, portable code
/// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead. /// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead.
/// ///
/// [`to_be_bytes`]: #method.to_be_bytes /// [`to_be_bytes`]: f64::to_be_bytes
/// [`to_le_bytes`]: #method.to_le_bytes /// [`to_le_bytes`]: f64::to_le_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -874,7 +874,7 @@ pub const fn from_bits(v: u64) -> Self {
/// ///
/// [`to_ne_bytes`] should be preferred over this whenever possible. /// [`to_ne_bytes`] should be preferred over this whenever possible.
/// ///
/// [`to_ne_bytes`]: #method.to_ne_bytes /// [`to_ne_bytes`]: f64::to_ne_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -934,8 +934,8 @@ pub const fn from_bits(v: u64) -> Self {
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
/// appropriate instead. /// appropriate instead.
/// ///
/// [`from_be_bytes`]: #method.from_be_bytes /// [`from_be_bytes`]: f64::from_be_bytes
/// [`from_le_bytes`]: #method.from_le_bytes /// [`from_le_bytes`]: f64::from_le_bytes
/// ///
/// # Examples /// # Examples
/// ///

View File

@ -1067,7 +1067,7 @@ pub const fn wrapping_neg(self) -> Self {
/// ///
/// Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to /// Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to
/// the range of the type, rather than the bits shifted out of the LHS being returned to the other end. /// the range of the type, rather than the bits shifted out of the LHS being returned to the other end.
/// The primitive integer types all implement a [`rotate_left`](#method.rotate_left) function, /// The primitive integer types all implement a [`rotate_left`](Self::rotate_left) function,
/// which may be what you want instead. /// which may be what you want instead.
/// ///
/// # Examples /// # Examples
@ -1096,7 +1096,7 @@ pub const fn wrapping_shl(self, rhs: u32) -> Self {
/// ///
/// Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted /// Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted
/// to the range of the type, rather than the bits shifted out of the LHS being returned to the other /// to the range of the type, rather than the bits shifted out of the LHS being returned to the other
/// end. The primitive integer types all implement a [`rotate_right`](#method.rotate_right) function, /// end. The primitive integer types all implement a [`rotate_right`](Self::rotate_right) function,
/// which may be what you want instead. /// which may be what you want instead.
/// ///
/// # Examples /// # Examples
@ -1812,8 +1812,8 @@ pub const fn is_negative(self) -> bool { self < 0 }
/// ///
#[doc = $to_xe_bytes_doc] #[doc = $to_xe_bytes_doc]
/// ///
/// [`to_be_bytes`]: #method.to_be_bytes /// [`to_be_bytes`]: Self::to_be_bytes
/// [`to_le_bytes`]: #method.to_le_bytes /// [`to_le_bytes`]: Self::to_le_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -1845,7 +1845,7 @@ pub const fn is_negative(self) -> bool { self < 0 }
/// ///
/// [`to_ne_bytes`] should be preferred over this whenever possible. /// [`to_ne_bytes`] should be preferred over this whenever possible.
/// ///
/// [`to_ne_bytes`]: #method.to_ne_bytes /// [`to_ne_bytes`]: Self::to_ne_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -1937,8 +1937,8 @@ pub const fn is_negative(self) -> bool { self < 0 }
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
/// appropriate instead. /// appropriate instead.
/// ///
/// [`from_be_bytes`]: #method.from_be_bytes /// [`from_be_bytes`]: Self::from_be_bytes
/// [`from_le_bytes`]: #method.from_le_bytes /// [`from_le_bytes`]: Self::from_le_bytes
/// ///
#[doc = $to_xe_bytes_doc] #[doc = $to_xe_bytes_doc]
/// ///
@ -1976,7 +1976,7 @@ pub const fn is_negative(self) -> bool { self < 0 }
} }
/// New code should prefer to use /// New code should prefer to use
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN).")] #[doc = concat!("[`", stringify!($SelfT), "::MIN", "`] instead.")]
/// ///
/// Returns the smallest value that can be represented by this integer type. /// Returns the smallest value that can be represented by this integer type.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@ -1989,7 +1989,7 @@ pub const fn min_value() -> Self {
} }
/// New code should prefer to use /// New code should prefer to use
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX).")] #[doc = concat!("[`", stringify!($SelfT), "::MAX", "`] instead.")]
/// ///
/// Returns the largest value that can be represented by this integer type. /// Returns the largest value that can be represented by this integer type.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View File

@ -193,7 +193,7 @@ pub const fn is_ascii(&self) -> bool {
/// assert_eq!(65, lowercase_a.to_ascii_uppercase()); /// assert_eq!(65, lowercase_a.to_ascii_uppercase());
/// ``` /// ```
/// ///
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase /// [`make_ascii_uppercase`]: Self::make_ascii_uppercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline] #[inline]
pub fn to_ascii_uppercase(&self) -> u8 { pub fn to_ascii_uppercase(&self) -> u8 {
@ -216,7 +216,7 @@ pub fn to_ascii_uppercase(&self) -> u8 {
/// assert_eq!(97, uppercase_a.to_ascii_lowercase()); /// assert_eq!(97, uppercase_a.to_ascii_lowercase());
/// ``` /// ```
/// ///
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase /// [`make_ascii_lowercase`]: Self::make_ascii_lowercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline] #[inline]
pub fn to_ascii_lowercase(&self) -> u8 { pub fn to_ascii_lowercase(&self) -> u8 {
@ -266,7 +266,7 @@ pub fn eq_ignore_ascii_case(&self, other: &u8) -> bool {
/// assert_eq!(b'A', byte); /// assert_eq!(b'A', byte);
/// ``` /// ```
/// ///
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase /// [`to_ascii_uppercase`]: Self::to_ascii_uppercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline] #[inline]
pub fn make_ascii_uppercase(&mut self) { pub fn make_ascii_uppercase(&mut self) {
@ -291,7 +291,7 @@ pub fn make_ascii_uppercase(&mut self) {
/// assert_eq!(b'a', byte); /// assert_eq!(b'a', byte);
/// ``` /// ```
/// ///
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase /// [`to_ascii_lowercase`]: Self::to_ascii_lowercase
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[inline] #[inline]
pub fn make_ascii_lowercase(&mut self) { pub fn make_ascii_lowercase(&mut self) {
@ -723,9 +723,6 @@ impl usize {
/// This `enum` is used as the return type for [`f32::classify`] and [`f64::classify`]. See /// This `enum` is used as the return type for [`f32::classify`] and [`f64::classify`]. See
/// their documentation for more. /// their documentation for more.
/// ///
/// [`f32::classify`]: ../../std/primitive.f32.html#method.classify
/// [`f64::classify`]: ../../std/primitive.f64.html#method.classify
///
/// # Examples /// # Examples
/// ///
/// ``` /// ```

View File

@ -994,7 +994,7 @@ pub const fn wrapping_neg(self) -> Self {
/// RHS of a wrapping shift-left is restricted to the range /// RHS of a wrapping shift-left is restricted to the range
/// of the type, rather than the bits shifted out of the LHS /// of the type, rather than the bits shifted out of the LHS
/// being returned to the other end. The primitive integer /// being returned to the other end. The primitive integer
/// types all implement a [`rotate_left`](#method.rotate_left) function, /// types all implement a [`rotate_left`](Self::rotate_left) function,
/// which may be what you want instead. /// which may be what you want instead.
/// ///
/// # Examples /// # Examples
@ -1026,7 +1026,7 @@ pub const fn wrapping_shl(self, rhs: u32) -> Self {
/// RHS of a wrapping shift-right is restricted to the range /// RHS of a wrapping shift-right is restricted to the range
/// of the type, rather than the bits shifted out of the LHS /// of the type, rather than the bits shifted out of the LHS
/// being returned to the other end. The primitive integer /// being returned to the other end. The primitive integer
/// types all implement a [`rotate_right`](#method.rotate_right) function, /// types all implement a [`rotate_right`](Self::rotate_right) function,
/// which may be what you want instead. /// which may be what you want instead.
/// ///
/// # Examples /// # Examples
@ -1642,8 +1642,8 @@ pub const fn wrapping_next_power_of_two(self) -> Self {
/// ///
#[doc = $to_xe_bytes_doc] #[doc = $to_xe_bytes_doc]
/// ///
/// [`to_be_bytes`]: #method.to_be_bytes /// [`to_be_bytes`]: Self::to_be_bytes
/// [`to_le_bytes`]: #method.to_le_bytes /// [`to_le_bytes`]: Self::to_le_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -1675,7 +1675,7 @@ pub const fn wrapping_next_power_of_two(self) -> Self {
/// ///
/// [`to_ne_bytes`] should be preferred over this whenever possible. /// [`to_ne_bytes`] should be preferred over this whenever possible.
/// ///
/// [`to_ne_bytes`]: #method.to_ne_bytes /// [`to_ne_bytes`]: Self::to_ne_bytes
/// ///
/// # Examples /// # Examples
/// ///
@ -1767,8 +1767,8 @@ pub const fn wrapping_next_power_of_two(self) -> Self {
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as /// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
/// appropriate instead. /// appropriate instead.
/// ///
/// [`from_be_bytes`]: #method.from_be_bytes /// [`from_be_bytes`]: Self::from_be_bytes
/// [`from_le_bytes`]: #method.from_le_bytes /// [`from_le_bytes`]: Self::from_le_bytes
/// ///
#[doc = $from_xe_bytes_doc] #[doc = $from_xe_bytes_doc]
/// ///
@ -1806,8 +1806,7 @@ pub const fn wrapping_next_power_of_two(self) -> Self {
} }
/// New code should prefer to use /// New code should prefer to use
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN).")] #[doc = concat!("[`", stringify!($SelfT), "::MIN", "`] instead.")]
/// instead.
/// ///
/// Returns the smallest value that can be represented by this integer type. /// Returns the smallest value that can be represented by this integer type.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@ -1818,8 +1817,7 @@ pub const fn wrapping_next_power_of_two(self) -> Self {
pub const fn min_value() -> Self { Self::MIN } pub const fn min_value() -> Self { Self::MIN }
/// New code should prefer to use /// New code should prefer to use
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX).")] #[doc = concat!("[`", stringify!($SelfT), "::MAX", "`] instead.")]
/// instead.
/// ///
/// Returns the largest value that can be represented by this integer type. /// Returns the largest value that can be represented by this integer type.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]