Skip to content

Commit c9cf922

Browse files
authored
Rollup merge of rust-lang#75807 - jyn514:num-intra-link, r=poliorcetics
Convert core/num/mod.rs to intra-doc links Helps with rust-lang#75080. This can't convert the associated constants `MAX` and `MIN` until rust-lang#74489 is merged. r? `@poliorcetics`
2 parents 89d32eb + ea3118c commit c9cf922

File tree

6 files changed

+34
-42
lines changed

6 files changed

+34
-42
lines changed

library/core/src/num/error.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ impl From<!> for TryFromIntError {
5454
///
5555
/// Among other causes, `ParseIntError` can be thrown because of leading or trailing whitespace
5656
/// in the string e.g., when it is obtained from the standard input.
57-
/// Using the [`str.trim()`] method ensures that no whitespace remains before parsing.
58-
///
59-
/// [`str.trim()`]: ../../std/primitive.str.html#method.trim
60-
/// [`i8::from_str_radix`]: ../../std/primitive.i8.html#method.from_str_radix
57+
/// Using the [`str::trim()`] method ensures that no whitespace remains before parsing.
6158
///
6259
/// # Example
6360
///

library/core/src/num/f32.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::mem;
1818
use crate::num::FpCategory;
1919

2020
/// The radix or base of the internal representation of `f32`.
21-
/// Use [`f32::RADIX`](../../std/primitive.f32.html#associatedconstant.RADIX) instead.
21+
/// Use [`f32::RADIX`] instead.
2222
///
2323
/// # Examples
2424
///
@@ -832,8 +832,8 @@ impl f32 {
832832
/// As the target platform's native endianness is used, portable code
833833
/// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead.
834834
///
835-
/// [`to_be_bytes`]: #method.to_be_bytes
836-
/// [`to_le_bytes`]: #method.to_le_bytes
835+
/// [`to_be_bytes`]: f32::to_be_bytes
836+
/// [`to_le_bytes`]: f32::to_le_bytes
837837
///
838838
/// # Examples
839839
///
@@ -860,7 +860,7 @@ impl f32 {
860860
///
861861
/// [`to_ne_bytes`] should be preferred over this whenever possible.
862862
///
863-
/// [`to_ne_bytes`]: #method.to_ne_bytes
863+
/// [`to_ne_bytes`]: f32::to_ne_bytes
864864
///
865865
/// # Examples
866866
///
@@ -920,8 +920,8 @@ impl f32 {
920920
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
921921
/// appropriate instead.
922922
///
923-
/// [`from_be_bytes`]: #method.from_be_bytes
924-
/// [`from_le_bytes`]: #method.from_le_bytes
923+
/// [`from_be_bytes`]: f32::from_be_bytes
924+
/// [`from_le_bytes`]: f32::from_le_bytes
925925
///
926926
/// # Examples
927927
///

library/core/src/num/f64.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ impl f64 {
846846
/// As the target platform's native endianness is used, portable code
847847
/// should use [`to_be_bytes`] or [`to_le_bytes`], as appropriate, instead.
848848
///
849-
/// [`to_be_bytes`]: #method.to_be_bytes
850-
/// [`to_le_bytes`]: #method.to_le_bytes
849+
/// [`to_be_bytes`]: f64::to_be_bytes
850+
/// [`to_le_bytes`]: f64::to_le_bytes
851851
///
852852
/// # Examples
853853
///
@@ -874,7 +874,7 @@ impl f64 {
874874
///
875875
/// [`to_ne_bytes`] should be preferred over this whenever possible.
876876
///
877-
/// [`to_ne_bytes`]: #method.to_ne_bytes
877+
/// [`to_ne_bytes`]: f64::to_ne_bytes
878878
///
879879
/// # Examples
880880
///
@@ -934,8 +934,8 @@ impl f64 {
934934
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
935935
/// appropriate instead.
936936
///
937-
/// [`from_be_bytes`]: #method.from_be_bytes
938-
/// [`from_le_bytes`]: #method.from_le_bytes
937+
/// [`from_be_bytes`]: f64::from_be_bytes
938+
/// [`from_le_bytes`]: f64::from_le_bytes
939939
///
940940
/// # Examples
941941
///

library/core/src/num/int_macros.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ macro_rules! int_impl {
10671067
///
10681068
/// Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to
10691069
/// the range of the type, rather than the bits shifted out of the LHS being returned to the other end.
1070-
/// The primitive integer types all implement a [`rotate_left`](#method.rotate_left) function,
1070+
/// The primitive integer types all implement a [`rotate_left`](Self::rotate_left) function,
10711071
/// which may be what you want instead.
10721072
///
10731073
/// # Examples
@@ -1096,7 +1096,7 @@ macro_rules! int_impl {
10961096
///
10971097
/// Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted
10981098
/// to the range of the type, rather than the bits shifted out of the LHS being returned to the other
1099-
/// end. The primitive integer types all implement a [`rotate_right`](#method.rotate_right) function,
1099+
/// end. The primitive integer types all implement a [`rotate_right`](Self::rotate_right) function,
11001100
/// which may be what you want instead.
11011101
///
11021102
/// # Examples
@@ -1812,8 +1812,8 @@ macro_rules! int_impl {
18121812
///
18131813
#[doc = $to_xe_bytes_doc]
18141814
///
1815-
/// [`to_be_bytes`]: #method.to_be_bytes
1816-
/// [`to_le_bytes`]: #method.to_le_bytes
1815+
/// [`to_be_bytes`]: Self::to_be_bytes
1816+
/// [`to_le_bytes`]: Self::to_le_bytes
18171817
///
18181818
/// # Examples
18191819
///
@@ -1845,7 +1845,7 @@ macro_rules! int_impl {
18451845
///
18461846
/// [`to_ne_bytes`] should be preferred over this whenever possible.
18471847
///
1848-
/// [`to_ne_bytes`]: #method.to_ne_bytes
1848+
/// [`to_ne_bytes`]: Self::to_ne_bytes
18491849
///
18501850
/// # Examples
18511851
///
@@ -1937,8 +1937,8 @@ macro_rules! int_impl {
19371937
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
19381938
/// appropriate instead.
19391939
///
1940-
/// [`from_be_bytes`]: #method.from_be_bytes
1941-
/// [`from_le_bytes`]: #method.from_le_bytes
1940+
/// [`from_be_bytes`]: Self::from_be_bytes
1941+
/// [`from_le_bytes`]: Self::from_le_bytes
19421942
///
19431943
#[doc = $to_xe_bytes_doc]
19441944
///
@@ -1976,7 +1976,7 @@ macro_rules! int_impl {
19761976
}
19771977

19781978
/// New code should prefer to use
1979-
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN).")]
1979+
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`] instead.")]
19801980
///
19811981
/// Returns the smallest value that can be represented by this integer type.
19821982
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1989,7 +1989,7 @@ macro_rules! int_impl {
19891989
}
19901990

19911991
/// New code should prefer to use
1992-
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX).")]
1992+
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`] instead.")]
19931993
///
19941994
/// Returns the largest value that can be represented by this integer type.
19951995
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/num/mod.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl u8 {
193193
/// assert_eq!(65, lowercase_a.to_ascii_uppercase());
194194
/// ```
195195
///
196-
/// [`make_ascii_uppercase`]: #method.make_ascii_uppercase
196+
/// [`make_ascii_uppercase`]: Self::make_ascii_uppercase
197197
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
198198
#[inline]
199199
pub fn to_ascii_uppercase(&self) -> u8 {
@@ -216,7 +216,7 @@ impl u8 {
216216
/// assert_eq!(97, uppercase_a.to_ascii_lowercase());
217217
/// ```
218218
///
219-
/// [`make_ascii_lowercase`]: #method.make_ascii_lowercase
219+
/// [`make_ascii_lowercase`]: Self::make_ascii_lowercase
220220
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
221221
#[inline]
222222
pub fn to_ascii_lowercase(&self) -> u8 {
@@ -266,7 +266,7 @@ impl u8 {
266266
/// assert_eq!(b'A', byte);
267267
/// ```
268268
///
269-
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
269+
/// [`to_ascii_uppercase`]: Self::to_ascii_uppercase
270270
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
271271
#[inline]
272272
pub fn make_ascii_uppercase(&mut self) {
@@ -291,7 +291,7 @@ impl u8 {
291291
/// assert_eq!(b'a', byte);
292292
/// ```
293293
///
294-
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
294+
/// [`to_ascii_lowercase`]: Self::to_ascii_lowercase
295295
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
296296
#[inline]
297297
pub fn make_ascii_lowercase(&mut self) {
@@ -723,9 +723,6 @@ impl usize {
723723
/// This `enum` is used as the return type for [`f32::classify`] and [`f64::classify`]. See
724724
/// their documentation for more.
725725
///
726-
/// [`f32::classify`]: ../../std/primitive.f32.html#method.classify
727-
/// [`f64::classify`]: ../../std/primitive.f64.html#method.classify
728-
///
729726
/// # Examples
730727
///
731728
/// ```

library/core/src/num/uint_macros.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ macro_rules! uint_impl {
994994
/// RHS of a wrapping shift-left is restricted to the range
995995
/// of the type, rather than the bits shifted out of the LHS
996996
/// being returned to the other end. The primitive integer
997-
/// types all implement a [`rotate_left`](#method.rotate_left) function,
997+
/// types all implement a [`rotate_left`](Self::rotate_left) function,
998998
/// which may be what you want instead.
999999
///
10001000
/// # Examples
@@ -1026,7 +1026,7 @@ macro_rules! uint_impl {
10261026
/// RHS of a wrapping shift-right is restricted to the range
10271027
/// of the type, rather than the bits shifted out of the LHS
10281028
/// being returned to the other end. The primitive integer
1029-
/// types all implement a [`rotate_right`](#method.rotate_right) function,
1029+
/// types all implement a [`rotate_right`](Self::rotate_right) function,
10301030
/// which may be what you want instead.
10311031
///
10321032
/// # Examples
@@ -1642,8 +1642,8 @@ macro_rules! uint_impl {
16421642
///
16431643
#[doc = $to_xe_bytes_doc]
16441644
///
1645-
/// [`to_be_bytes`]: #method.to_be_bytes
1646-
/// [`to_le_bytes`]: #method.to_le_bytes
1645+
/// [`to_be_bytes`]: Self::to_be_bytes
1646+
/// [`to_le_bytes`]: Self::to_le_bytes
16471647
///
16481648
/// # Examples
16491649
///
@@ -1675,7 +1675,7 @@ macro_rules! uint_impl {
16751675
///
16761676
/// [`to_ne_bytes`] should be preferred over this whenever possible.
16771677
///
1678-
/// [`to_ne_bytes`]: #method.to_ne_bytes
1678+
/// [`to_ne_bytes`]: Self::to_ne_bytes
16791679
///
16801680
/// # Examples
16811681
///
@@ -1767,8 +1767,8 @@ macro_rules! uint_impl {
17671767
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as
17681768
/// appropriate instead.
17691769
///
1770-
/// [`from_be_bytes`]: #method.from_be_bytes
1771-
/// [`from_le_bytes`]: #method.from_le_bytes
1770+
/// [`from_be_bytes`]: Self::from_be_bytes
1771+
/// [`from_le_bytes`]: Self::from_le_bytes
17721772
///
17731773
#[doc = $from_xe_bytes_doc]
17741774
///
@@ -1806,8 +1806,7 @@ macro_rules! uint_impl {
18061806
}
18071807

18081808
/// New code should prefer to use
1809-
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN).")]
1810-
/// instead.
1809+
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`] instead.")]
18111810
///
18121811
/// Returns the smallest value that can be represented by this integer type.
18131812
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1818,8 +1817,7 @@ macro_rules! uint_impl {
18181817
pub const fn min_value() -> Self { Self::MIN }
18191818

18201819
/// New code should prefer to use
1821-
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX).")]
1822-
/// instead.
1820+
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`] instead.")]
18231821
///
18241822
/// Returns the largest value that can be represented by this integer type.
18251823
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)