Skip to content

Commit 9c75ee6

Browse files
authored
Rollup merge of rust-lang#80991 - calebsander:fix/fmt-link, r=m-ou-se
Fix formatting specifiers doc links d36e3e2 seems to have inadvertently changed many of these links to point to `core::fmt` instead of `std::fmt`. The information about formatting specifiers is only documented in [`std::fmt`](https://doc.rust-lang.org/std/fmt/); [`core::fmt`](https://doc.rust-lang.org/core/fmt/) is empty. 3baf6a4 seems to have already fixed a couple of these links to point back to `std::fmt`.
2 parents 494cb3c + 391b4cc commit 9c75ee6

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

library/core/src/fmt/mod.rs

+27-9
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ impl Display for Arguments<'_> {
456456
///
457457
/// When used with the alternate format specifier `#?`, the output is pretty-printed.
458458
///
459-
/// For more information on formatters, see [the module-level documentation][self].
459+
/// For more information on formatters, see [the module-level documentation][module].
460+
///
461+
/// [module]: ../../std/fmt/index.html
460462
///
461463
/// This trait can be used with `#[derive]` if all fields implement `Debug`. When
462464
/// `derive`d for structs, it will use the name of the `struct`, then `{`, then a
@@ -602,7 +604,9 @@ pub use macros::Debug;
602604
/// `Display` is similar to [`Debug`], but `Display` is for user-facing
603605
/// output, and so cannot be derived.
604606
///
605-
/// For more information on formatters, see [the module-level documentation][self].
607+
/// For more information on formatters, see [the module-level documentation][module].
608+
///
609+
/// [module]: ../../std/fmt/index.html
606610
///
607611
/// # Examples
608612
///
@@ -674,7 +678,9 @@ pub trait Display {
674678
///
675679
/// The alternate flag, `#`, adds a `0o` in front of the output.
676680
///
677-
/// For more information on formatters, see [the module-level documentation][self].
681+
/// For more information on formatters, see [the module-level documentation][module].
682+
///
683+
/// [module]: ../../std/fmt/index.html
678684
///
679685
/// # Examples
680686
///
@@ -726,7 +732,9 @@ pub trait Octal {
726732
///
727733
/// The alternate flag, `#`, adds a `0b` in front of the output.
728734
///
729-
/// For more information on formatters, see [the module-level documentation][self].
735+
/// For more information on formatters, see [the module-level documentation][module].
736+
///
737+
/// [module]: ../../std/fmt/index.html
730738
///
731739
/// # Examples
732740
///
@@ -782,7 +790,9 @@ pub trait Binary {
782790
///
783791
/// The alternate flag, `#`, adds a `0x` in front of the output.
784792
///
785-
/// For more information on formatters, see [the module-level documentation][self].
793+
/// For more information on formatters, see [the module-level documentation][module].
794+
///
795+
/// [module]: ../../std/fmt/index.html
786796
///
787797
/// # Examples
788798
///
@@ -835,7 +845,9 @@ pub trait LowerHex {
835845
///
836846
/// The alternate flag, `#`, adds a `0x` in front of the output.
837847
///
838-
/// For more information on formatters, see [the module-level documentation][self].
848+
/// For more information on formatters, see [the module-level documentation][module].
849+
///
850+
/// [module]: ../../std/fmt/index.html
839851
///
840852
/// # Examples
841853
///
@@ -883,7 +895,9 @@ pub trait UpperHex {
883895
/// The `Pointer` trait should format its output as a memory location. This is commonly presented
884896
/// as hexadecimal.
885897
///
886-
/// For more information on formatters, see [the module-level documentation][self].
898+
/// For more information on formatters, see [the module-level documentation][module].
899+
///
900+
/// [module]: ../../std/fmt/index.html
887901
///
888902
/// # Examples
889903
///
@@ -932,7 +946,9 @@ pub trait Pointer {
932946
///
933947
/// The `LowerExp` trait should format its output in scientific notation with a lower-case `e`.
934948
///
935-
/// For more information on formatters, see [the module-level documentation][self].
949+
/// For more information on formatters, see [the module-level documentation][module].
950+
///
951+
/// [module]: ../../std/fmt/index.html
936952
///
937953
/// # Examples
938954
///
@@ -981,7 +997,9 @@ pub trait LowerExp {
981997
///
982998
/// The `UpperExp` trait should format its output in scientific notation with an upper-case `E`.
983999
///
984-
/// For more information on formatters, see [the module-level documentation][self].
1000+
/// For more information on formatters, see [the module-level documentation][module].
1001+
///
1002+
/// [module]: ../../std/fmt/index.html
9851003
///
9861004
/// # Examples
9871005
///

library/core/src/macros/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ macro_rules! write {
401401
/// For more information, see [`write!`]. For information on the format string syntax, see
402402
/// [`std::fmt`].
403403
///
404-
/// [`std::fmt`]: crate::fmt
404+
/// [`std::fmt`]: ../std/fmt/index.html
405405
///
406406
/// # Examples
407407
///
@@ -730,7 +730,7 @@ pub(crate) mod builtin {
730730
/// [`Display`]: crate::fmt::Display
731731
/// [`Debug`]: crate::fmt::Debug
732732
/// [`fmt::Arguments`]: crate::fmt::Arguments
733-
/// [`std::fmt`]: crate::fmt
733+
/// [`std::fmt`]: ../std/fmt/index.html
734734
/// [`format!`]: ../std/macro.format.html
735735
/// [`println!`]: ../std/macro.println.html
736736
///
@@ -1194,7 +1194,7 @@ pub(crate) mod builtin {
11941194
/// be provided with or without arguments for formatting. See [`std::fmt`]
11951195
/// for syntax for this form.
11961196
///
1197-
/// [`std::fmt`]: crate::fmt
1197+
/// [`std::fmt`]: ../std/fmt/index.html
11981198
///
11991199
/// # Examples
12001200
///

0 commit comments

Comments
 (0)