Skip to content

Commit 4d46735

Browse files
committed
Convert the rest of the standard library primitives to intra-doc links
Note that float methods in `core::intrinsics` weren't converted because they are only defined in `std` (using language item hacks).
1 parent 9a75f4f commit 4d46735

File tree

21 files changed

+128
-138
lines changed

21 files changed

+128
-138
lines changed

library/core/src/char/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
//! [Unicode code point]: http://www.unicode.org/glossary/#code_point
1010
//!
1111
//! This module exists for technical reasons, the primary documentation for
12-
//! `char` is directly on [the `char` primitive type](../../std/primitive.char.html)
13-
//! itself.
12+
//! `char` is directly on [the `char` primitive type][char] itself.
1413
//!
1514
//! This module is the home of the iterator implementations for the iterators
1615
//! implemented on `char`, as well as some useful constants and conversion

library/core/src/num/f32.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants specific to the `f32` single-precision floating point type.
22
//!
3-
//! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
3+
//! *[See also the `f32` primitive type][f32].*
44
//!
55
//! Mathematically significant numbers are provided in the `consts` sub-module.
66
//!
@@ -35,7 +35,7 @@ use crate::num::FpCategory;
3535
pub const RADIX: u32 = f32::RADIX;
3636

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

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

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

9898
/// Smallest finite `f32` value.
99-
/// Use [`f32::MIN`](../../std/primitive.f32.html#associatedconstant.MIN) instead.
99+
/// Use [`f32::MIN`] instead.
100100
///
101101
/// # Examples
102102
///
@@ -113,7 +113,7 @@ pub const EPSILON: f32 = f32::EPSILON;
113113
pub const MIN: f32 = f32::MIN;
114114

115115
/// Smallest positive normal `f32` value.
116-
/// Use [`f32::MIN_POSITIVE`](../../std/primitive.f32.html#associatedconstant.MIN_POSITIVE) instead.
116+
/// Use [`f32::MIN_POSITIVE`] instead.
117117
///
118118
/// # Examples
119119
///
@@ -133,7 +133,7 @@ pub const MIN: f32 = f32::MIN;
133133
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
134134

135135
/// Largest finite `f32` value.
136-
/// Use [`f32::MAX`](../../std/primitive.f32.html#associatedconstant.MAX) instead.
136+
/// Use [`f32::MAX`] instead.
137137
///
138138
/// # Examples
139139
///
@@ -150,7 +150,7 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
150150
pub const MAX: f32 = f32::MAX;
151151

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

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

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

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

232232
/// Not a Number (NaN).
233-
/// Use [`f32::NAN`](../../std/primitive.f32.html#associatedconstant.NAN) instead.
233+
/// Use [`f32::NAN`] instead.
234234
///
235235
/// # Examples
236236
///
@@ -247,7 +247,7 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
247247
pub const NAN: f32 = f32::NAN;
248248

249249
/// Infinity (∞).
250-
/// Use [`f32::INFINITY`](../../std/primitive.f32.html#associatedconstant.INFINITY) instead.
250+
/// Use [`f32::INFINITY`] instead.
251251
///
252252
/// # Examples
253253
///
@@ -267,7 +267,7 @@ pub const NAN: f32 = f32::NAN;
267267
pub const INFINITY: f32 = f32::INFINITY;
268268

269269
/// Negative infinity (−∞).
270-
/// Use [`f32::NEG_INFINITY`](../../std/primitive.f32.html#associatedconstant.NEG_INFINITY) instead.
270+
/// Use [`f32::NEG_INFINITY`] instead.
271271
///
272272
/// # Examples
273273
///

library/core/src/num/f64.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants specific to the `f64` double-precision floating point type.
22
//!
3-
//! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
3+
//! *[See also the `f64` primitive type][f64].*
44
//!
55
//! Mathematically significant numbers are provided in the `consts` sub-module.
66
//!
@@ -18,7 +18,7 @@ use crate::mem;
1818
use crate::num::FpCategory;
1919

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

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

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

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

9898
/// Smallest finite `f64` value.
99-
/// Use [`f64::MIN`](../../std/primitive.f64.html#associatedconstant.MIN) instead.
99+
/// Use [`f64::MIN`] instead.
100100
///
101101
/// # Examples
102102
///
@@ -113,7 +113,7 @@ pub const EPSILON: f64 = f64::EPSILON;
113113
pub const MIN: f64 = f64::MIN;
114114

115115
/// Smallest positive normal `f64` value.
116-
/// Use [`f64::MIN_POSITIVE`](../../std/primitive.f64.html#associatedconstant.MIN_POSITIVE) instead.
116+
/// Use [`f64::MIN_POSITIVE`] instead.
117117
///
118118
/// # Examples
119119
///
@@ -133,7 +133,7 @@ pub const MIN: f64 = f64::MIN;
133133
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
134134

135135
/// Largest finite `f64` value.
136-
/// Use [`f64::MAX`](../../std/primitive.f64.html#associatedconstant.MAX) instead.
136+
/// Use [`f64::MAX`] instead.
137137
///
138138
/// # Examples
139139
///
@@ -150,7 +150,7 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
150150
pub const MAX: f64 = f64::MAX;
151151

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

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

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

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

232232
/// Not a Number (NaN).
233-
/// Use [`f64::NAN`](../../std/primitive.f64.html#associatedconstant.NAN) instead.
233+
/// Use [`f64::NAN`] instead.
234234
///
235235
/// # Examples
236236
///
@@ -247,7 +247,7 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
247247
pub const NAN: f64 = f64::NAN;
248248

249249
/// Infinity (∞).
250-
/// Use [`f64::INFINITY`](../../std/primitive.f64.html#associatedconstant.INFINITY) instead.
250+
/// Use [`f64::INFINITY`] instead.
251251
///
252252
/// # Examples
253253
///
@@ -267,7 +267,7 @@ pub const NAN: f64 = f64::NAN;
267267
pub const INFINITY: f64 = f64::INFINITY;
268268

269269
/// Negative infinity (−∞).
270-
/// Use [`f64::NEG_INFINITY`](../../std/primitive.f64.html#associatedconstant.NEG_INFINITY) instead.
270+
/// Use [`f64::NEG_INFINITY`] instead.
271271
///
272272
/// # Examples
273273
///

library/core/src/num/shells/i128.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 128-bit signed integer type.
22
//!
3-
//! *[See also the `i128` primitive type](../../std/primitive.i128.html).*
3+
//! *[See also the `i128` primitive type][i128].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/i16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 16-bit signed integer type.
22
//!
3-
//! *[See also the `i16` primitive type](../../std/primitive.i16.html).*
3+
//! *[See also the `i16` primitive type][i16].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/i32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 32-bit signed integer type.
22
//!
3-
//! *[See also the `i32` primitive type](../../std/primitive.i32.html).*
3+
//! *[See also the `i32` primitive type][i32].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/i64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 64-bit signed integer type.
22
//!
3-
//! *[See also the `i64` primitive type](../../std/primitive.i64.html).*
3+
//! *[See also the `i64` primitive type][i64].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/i8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 8-bit signed integer type.
22
//!
3-
//! *[See also the `i8` primitive type](../../std/primitive.i8.html).*
3+
//! *[See also the `i8` primitive type][i8].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/int_macros.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ macro_rules! int_module {
55
($T:ident, #[$attr:meta]) => (
66
#[doc = concat!(
77
"The smallest value that can be represented by this integer type. Use ",
8-
"[`", stringify!($T), "::MIN", "`](../../std/primitive.", stringify!($T), ".html#associatedconstant.MIN)",
9-
" instead.",
8+
"[`", stringify!($T), "::MIN", "`] instead."
109
)]
1110
///
1211
/// # Examples
@@ -25,8 +24,7 @@ macro_rules! int_module {
2524

2625
#[doc = concat!(
2726
"The largest value that can be represented by this integer type. Use ",
28-
"[`", stringify!($T), "::MAX", "`](../../std/primitive.", stringify!($T), ".html#associatedconstant.MAX)",
29-
" instead.",
27+
"[`", stringify!($T), "::MAX", "`] instead."
3028
)]
3129
///
3230
/// # Examples

library/core/src/num/shells/isize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the pointer-sized signed integer type.
22
//!
3-
//! *[See also the `isize` primitive type](../../std/primitive.isize.html).*
3+
//! *[See also the `isize` primitive type][isize].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/u128.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 128-bit unsigned integer type.
22
//!
3-
//! *[See also the `u128` primitive type](../../std/primitive.u128.html).*
3+
//! *[See also the `u128` primitive type][u128].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/u16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 16-bit unsigned integer type.
22
//!
3-
//! *[See also the `u16` primitive type](../../std/primitive.u16.html).*
3+
//! *[See also the `u16` primitive type][u16].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/u32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 32-bit unsigned integer type.
22
//!
3-
//! *[See also the `u32` primitive type](../../std/primitive.u32.html).*
3+
//! *[See also the `u32` primitive type][u32].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/u64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 64-bit unsigned integer type.
22
//!
3-
//! *[See also the `u64` primitive type](../../std/primitive.u64.html).*
3+
//! *[See also the `u64` primitive type][u64].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/u8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the 8-bit unsigned integer type.
22
//!
3-
//! *[See also the `u8` primitive type](../../std/primitive.u8.html).*
3+
//! *[See also the `u8` primitive type][u8].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/num/shells/usize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Constants for the pointer-sized unsigned integer type.
22
//!
3-
//! *[See also the `usize` primitive type](../../std/primitive.usize.html).*
3+
//! *[See also the `usize` primitive type][usize].*
44
//!
55
//! New code should use the associated constants directly on the primitive type.
66

library/core/src/result.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,11 +1285,10 @@ impl<T> Result<T, T> {
12851285
/// `Err`.
12861286
///
12871287
/// This can be useful in conjunction with APIs such as
1288-
/// [`Atomic*::compare_exchange`], or [`slice::binary_search`][binary_search], but only in
1288+
/// [`Atomic*::compare_exchange`], or [`slice::binary_search`], but only in
12891289
/// cases where you don't care if the result was `Ok` or not.
12901290
///
12911291
/// [`Atomic*::compare_exchange`]: crate::sync::atomic::AtomicBool::compare_exchange
1292-
/// [binary_search]: ../../std/primitive.slice.html#method.binary_search
12931292
///
12941293
/// # Examples
12951294
///

0 commit comments

Comments
 (0)