From 5d32786b4f656f7b7e44a8afbf124e924dc12429 Mon Sep 17 00:00:00 2001 From: Camelid Date: Sat, 22 Aug 2020 15:44:00 -0700 Subject: [PATCH 1/3] Switch to intra-doc links in `std::macros` Also: * Fix typo in module docs * Link to `std::io::stderr` instead of `std::io::Stderr` to match the link text * Link to `std::io::stdout` --- library/std/src/macros.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 724dbada9305c..3ffce6f7223b8 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -1,6 +1,6 @@ //! Standard library macros //! -//! This modules contains a set of macros which are exported from the standard +//! This module contains a set of macros which are exported from the standard //! library. Each macro is available for use when linking against the standard //! library. @@ -29,9 +29,7 @@ macro_rules! panic { /// Use `print!` only for the primary output of your program. Use /// [`eprint!`] instead to print error and progress messages. /// -/// [`println!`]: ../std/macro.println.html -/// [flush]: ../std/io/trait.Write.html#tymethod.flush -/// [`eprint!`]: ../std/macro.eprint.html +/// [flush]: crate::io::Write::flush /// /// # Panics /// @@ -74,13 +72,12 @@ macro_rules! print { /// Use `println!` only for the primary output of your program. Use /// [`eprintln!`] instead to print error and progress messages. /// -/// [`format!`]: ../std/macro.format.html -/// [`std::fmt`]: ../std/fmt/index.html -/// [`eprintln!`]: ../std/macro.eprintln.html /// # Panics /// /// Panics if writing to `io::stdout` fails. /// +/// [`io::stdout`]: crate::io::stdout +/// /// # Examples /// /// ``` @@ -107,8 +104,8 @@ macro_rules! println { /// Use `eprint!` only for error and progress messages. Use `print!` /// instead for the primary output of your program. /// -/// [`io::stderr`]: ../std/io/struct.Stderr.html -/// [`print!`]: ../std/macro.print.html +/// [`io::stderr`]: crate::io::stderr +/// [`io::stdout`]: crate::io::stdout /// /// # Panics /// @@ -135,8 +132,8 @@ macro_rules! eprint { /// Use `eprintln!` only for error and progress messages. Use `println!` /// instead for the primary output of your program. /// -/// [`io::stderr`]: ../std/io/struct.Stderr.html -/// [`println!`]: ../std/macro.println.html +/// [`io::stderr`]: crate::io::stderr +/// [`io::stdout`]: crate::io::stdout /// /// # Panics /// From becf5ec4ea65d1805a3a9fe5a55e2db8a86b9e47 Mon Sep 17 00:00:00 2001 From: Camelid Date: Sat, 22 Aug 2020 17:41:40 -0700 Subject: [PATCH 2/3] Add missing intra-doc link --- library/std/src/macros.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 3ffce6f7223b8..d7be1bdb4f9f3 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -72,6 +72,8 @@ macro_rules! print { /// Use `println!` only for the primary output of your program. Use /// [`eprintln!`] instead to print error and progress messages. /// +/// [`std::fmt`]: crate::fmt +/// /// # Panics /// /// Panics if writing to `io::stdout` fails. From 637659be6a87da5c8972f147d7a508bb808d669b Mon Sep 17 00:00:00 2001 From: Camelid Date: Sat, 22 Aug 2020 20:23:50 -0700 Subject: [PATCH 3/3] Add missing links --- library/std/src/macros.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index d7be1bdb4f9f3..e8898d98ff35f 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -76,7 +76,7 @@ macro_rules! print { /// /// # Panics /// -/// Panics if writing to `io::stdout` fails. +/// Panics if writing to [`io::stdout`] fails. /// /// [`io::stdout`]: crate::io::stdout /// @@ -100,7 +100,7 @@ macro_rules! println { /// Prints to the standard error. /// /// Equivalent to the [`print!`] macro, except that output goes to -/// [`io::stderr`] instead of `io::stdout`. See [`print!`] for +/// [`io::stderr`] instead of [`io::stdout`]. See [`print!`] for /// example usage. /// /// Use `eprint!` only for error and progress messages. Use `print!` @@ -128,7 +128,7 @@ macro_rules! eprint { /// Prints to the standard error, with a newline. /// /// Equivalent to the [`println!`] macro, except that output goes to -/// [`io::stderr`] instead of `io::stdout`. See [`println!`] for +/// [`io::stderr`] instead of [`io::stdout`]. See [`println!`] for /// example usage. /// /// Use `eprintln!` only for error and progress messages. Use `println!`