Skip to content

Commit d36e3e2

Browse files
Use intra-doc-links in core::{char, macros, fmt}
1 parent 9d606d9 commit d36e3e2

File tree

3 files changed

+30
-114
lines changed

3 files changed

+30
-114
lines changed

library/core/src/char/mod.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ const MAX_THREE_B: u32 = 0x10000;
9494
/// Point], but only ones within a certain range. `MAX` is the highest valid
9595
/// code point that's a valid [Unicode Scalar Value].
9696
///
97-
/// [`char`]: ../../std/primitive.char.html
9897
/// [Unicode Scalar Value]: http://www.unicode.org/glossary/#unicode_scalar_value
9998
/// [Code Point]: http://www.unicode.org/glossary/#code_point
10099
#[stable(feature = "rust1", since = "1.0.0")]
@@ -114,8 +113,7 @@ pub const REPLACEMENT_CHARACTER: char = char::REPLACEMENT_CHARACTER;
114113
/// This `struct` is created by the [`escape_unicode`] method on [`char`]. See
115114
/// its documentation for more.
116115
///
117-
/// [`escape_unicode`]: ../../std/primitive.char.html#method.escape_unicode
118-
/// [`char`]: ../../std/primitive.char.html
116+
/// [`escape_unicode`]: char::escape_unicode
119117
#[derive(Clone, Debug)]
120118
#[stable(feature = "rust1", since = "1.0.0")]
121119
pub struct EscapeUnicode {
@@ -236,8 +234,7 @@ impl fmt::Display for EscapeUnicode {
236234
/// This `struct` is created by the [`escape_default`] method on [`char`]. See
237235
/// its documentation for more.
238236
///
239-
/// [`escape_default`]: ../../std/primitive.char.html#method.escape_default
240-
/// [`char`]: ../../std/primitive.char.html
237+
/// [`escape_default`]: char::escape_default
241238
#[derive(Clone, Debug)]
242239
#[stable(feature = "rust1", since = "1.0.0")]
243240
pub struct EscapeDefault {
@@ -345,8 +342,7 @@ impl fmt::Display for EscapeDefault {
345342
/// This `struct` is created by the [`escape_debug`] method on [`char`]. See its
346343
/// documentation for more.
347344
///
348-
/// [`escape_debug`]: ../../std/primitive.char.html#method.escape_debug
349-
/// [`char`]: ../../std/primitive.char.html
345+
/// [`escape_debug`]: char::escape_debug
350346
#[stable(feature = "char_escape_debug", since = "1.20.0")]
351347
#[derive(Clone, Debug)]
352348
pub struct EscapeDebug(EscapeDefault);
@@ -380,8 +376,7 @@ impl fmt::Display for EscapeDebug {
380376
/// This `struct` is created by the [`to_lowercase`] method on [`char`]. See
381377
/// its documentation for more.
382378
///
383-
/// [`to_lowercase`]: ../../std/primitive.char.html#method.to_lowercase
384-
/// [`char`]: ../../std/primitive.char.html
379+
/// [`to_lowercase`]: char::to_lowercase
385380
#[stable(feature = "rust1", since = "1.0.0")]
386381
#[derive(Debug, Clone)]
387382
pub struct ToLowercase(CaseMappingIter);
@@ -408,8 +403,7 @@ impl ExactSizeIterator for ToLowercase {}
408403
/// This `struct` is created by the [`to_uppercase`] method on [`char`]. See
409404
/// its documentation for more.
410405
///
411-
/// [`to_uppercase`]: ../../std/primitive.char.html#method.to_uppercase
412-
/// [`char`]: ../../std/primitive.char.html
406+
/// [`to_uppercase`]: char::to_uppercase
413407
#[stable(feature = "rust1", since = "1.0.0")]
414408
#[derive(Debug, Clone)]
415409
pub struct ToUppercase(CaseMappingIter);

library/core/src/fmt/mod.rs

+14-50
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ pub trait Write {
117117
///
118118
/// This function will return an instance of [`Error`] on error.
119119
///
120-
/// [`Error`]: struct.Error.html
121-
///
122120
/// # Examples
123121
///
124122
/// ```
@@ -146,9 +144,6 @@ pub trait Write {
146144
///
147145
/// This function will return an instance of [`Error`] on error.
148146
///
149-
/// [`char`]: ../../std/primitive.char.html
150-
/// [`Error`]: struct.Error.html
151-
///
152147
/// # Examples
153148
///
154149
/// ```
@@ -218,9 +213,6 @@ impl<W: Write + ?Sized> Write for &mut W {
218213
/// To interact with a `Formatter`, you'll call various methods to change the
219214
/// various options related to formatting. For examples, please see the
220215
/// documentation of the methods defined on `Formatter` below.
221-
///
222-
/// [`Debug`]: trait.Debug.html
223-
/// [`Display`]: trait.Display.html
224216
#[allow(missing_debug_implementations)]
225217
#[stable(feature = "rust1", since = "1.0.0")]
226218
pub struct Formatter<'a> {
@@ -378,7 +370,7 @@ impl<'a> Arguments<'a> {
378370
///
379371
/// The [`format_args!`] macro will safely create an instance of this structure.
380372
/// The macro validates the format string at compile-time so usage of the
381-
/// [`write`] and [`format`] functions can be safely performed.
373+
/// [`write()`] and [`format()`] functions can be safely performed.
382374
///
383375
/// You can use the `Arguments<'a>` that [`format_args!`] returns in `Debug`
384376
/// and `Display` contexts as seen below. The example also shows that `Debug`
@@ -392,9 +384,7 @@ impl<'a> Arguments<'a> {
392384
/// assert_eq!(display, debug);
393385
/// ```
394386
///
395-
/// [`format_args!`]: ../../std/macro.format_args.html
396-
/// [`format`]: ../../std/fmt/fn.format.html
397-
/// [`write`]: ../../std/fmt/fn.write.html
387+
/// [`format()`]: ../../std/fmt/fn.format.html
398388
#[stable(feature = "rust1", since = "1.0.0")]
399389
#[derive(Copy, Clone)]
400390
pub struct Arguments<'a> {
@@ -472,9 +462,7 @@ impl Display for Arguments<'_> {
472462
///
473463
/// When used with the alternate format specifier `#?`, the output is pretty-printed.
474464
///
475-
/// For more information on formatters, see [the module-level documentation][module].
476-
///
477-
/// [module]: ../../std/fmt/index.html
465+
/// For more information on formatters, see [the module-level documentation][self].
478466
///
479467
/// This trait can be used with `#[derive]` if all fields implement `Debug`. When
480468
/// `derive`d for structs, it will use the name of the `struct`, then `{`, then a
@@ -535,8 +523,7 @@ impl Display for Arguments<'_> {
535523
/// `Debug` implementations using either `derive` or the debug builder API
536524
/// on [`Formatter`] support pretty-printing using the alternate flag: `{:#?}`.
537525
///
538-
/// [`debug_struct`]: ../../std/fmt/struct.Formatter.html#method.debug_struct
539-
/// [`Formatter`]: ../../std/fmt/struct.Formatter.html
526+
/// [`debug_struct`]: Formatter::debug_struct
540527
///
541528
/// Pretty-printing with `#?`:
542529
///
@@ -618,14 +605,10 @@ pub use macros::Debug;
618605

619606
/// Format trait for an empty format, `{}`.
620607
///
621-
/// `Display` is similar to [`Debug`][debug], but `Display` is for user-facing
608+
/// `Display` is similar to [`Debug`], but `Display` is for user-facing
622609
/// output, and so cannot be derived.
623610
///
624-
/// [debug]: trait.Debug.html
625-
///
626-
/// For more information on formatters, see [the module-level documentation][module].
627-
///
628-
/// [module]: ../../std/fmt/index.html
611+
/// For more information on formatters, see [the module-level documentation][self].
629612
///
630613
/// # Examples
631614
///
@@ -697,9 +680,7 @@ pub trait Display {
697680
///
698681
/// The alternate flag, `#`, adds a `0o` in front of the output.
699682
///
700-
/// For more information on formatters, see [the module-level documentation][module].
701-
///
702-
/// [module]: ../../std/fmt/index.html
683+
/// For more information on formatters, see [the module-level documentation][self].
703684
///
704685
/// # Examples
705686
///
@@ -751,7 +732,7 @@ pub trait Octal {
751732
///
752733
/// The alternate flag, `#`, adds a `0b` in front of the output.
753734
///
754-
/// For more information on formatters, see [the module-level documentation][module].
735+
/// For more information on formatters, see [the module-level documentation][self].
755736
///
756737
/// # Examples
757738
///
@@ -790,12 +771,6 @@ pub trait Octal {
790771
/// "l as binary is: 0b000000000000000000000001101011"
791772
/// );
792773
/// ```
793-
///
794-
/// [module]: ../../std/fmt/index.html
795-
/// [`i8`]: ../../std/primitive.i8.html
796-
/// [`i128`]: ../../std/primitive.i128.html
797-
/// [`isize`]: ../../std/primitive.isize.html
798-
/// [`i32`]: ../../std/primitive.i32.html
799774
#[stable(feature = "rust1", since = "1.0.0")]
800775
pub trait Binary {
801776
/// Formats the value using the given formatter.
@@ -813,9 +788,7 @@ pub trait Binary {
813788
///
814789
/// The alternate flag, `#`, adds a `0x` in front of the output.
815790
///
816-
/// For more information on formatters, see [the module-level documentation][module].
817-
///
818-
/// [module]: ../../std/fmt/index.html
791+
/// For more information on formatters, see [the module-level documentation][self].
819792
///
820793
/// # Examples
821794
///
@@ -868,9 +841,7 @@ pub trait LowerHex {
868841
///
869842
/// The alternate flag, `#`, adds a `0x` in front of the output.
870843
///
871-
/// For more information on formatters, see [the module-level documentation][module].
872-
///
873-
/// [module]: ../../std/fmt/index.html
844+
/// For more information on formatters, see [the module-level documentation][self].
874845
///
875846
/// # Examples
876847
///
@@ -918,9 +889,7 @@ pub trait UpperHex {
918889
/// The `Pointer` trait should format its output as a memory location. This is commonly presented
919890
/// as hexadecimal.
920891
///
921-
/// For more information on formatters, see [the module-level documentation][module].
922-
///
923-
/// [module]: ../../std/fmt/index.html
892+
/// For more information on formatters, see [the module-level documentation][self].
924893
///
925894
/// # Examples
926895
///
@@ -967,9 +936,7 @@ pub trait Pointer {
967936
///
968937
/// The `LowerExp` trait should format its output in scientific notation with a lower-case `e`.
969938
///
970-
/// For more information on formatters, see [the module-level documentation][module].
971-
///
972-
/// [module]: ../../std/fmt/index.html
939+
/// For more information on formatters, see [the module-level documentation][self].
973940
///
974941
/// # Examples
975942
///
@@ -1018,9 +985,7 @@ pub trait LowerExp {
1018985
///
1019986
/// The `UpperExp` trait should format its output in scientific notation with an upper-case `E`.
1020987
///
1021-
/// For more information on formatters, see [the module-level documentation][module].
1022-
///
1023-
/// [module]: ../../std/fmt/index.html
988+
/// For more information on formatters, see [the module-level documentation][self].
1024989
///
1025990
/// # Examples
1026991
///
@@ -1812,8 +1777,7 @@ impl<'a> Formatter<'a> {
18121777
/// Creates a [`DebugStruct`] builder designed to assist with creation of
18131778
/// [`fmt::Debug`] implementations for structs.
18141779
///
1815-
/// [`DebugStruct`]: ../../std/fmt/struct.DebugStruct.html
1816-
/// [`fmt::Debug`]: ../../std/fmt/trait.Debug.html
1780+
/// [`fmt::Debug`]: self::Debug
18171781
///
18181782
/// # Examples
18191783
///

0 commit comments

Comments
 (0)