Skip to content

Commit bfac5d6

Browse files
authored
Auto merge of #36523 - Mark-Simulacrum:format-args-link, r=GuillaumeGomez
Add links between format_args! macro and std::fmt::Arguments struct r? @GuillaumeGomez
2 parents 55bf6a4 + ad63215 commit bfac5d6

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/libcore/fmt/mod.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,14 @@ impl<'a> Arguments<'a> {
272272
/// safely be done so, so no constructors are given and the fields are private
273273
/// to prevent modification.
274274
///
275-
/// The `format_args!` macro will safely create an instance of this structure
275+
/// The [`format_args!`] macro will safely create an instance of this structure
276276
/// and pass it to a function or closure, passed as the first argument. The
277-
/// macro validates the format string at compile-time so usage of the `write`
278-
/// and `format` functions can be safely performed.
277+
/// macro validates the format string at compile-time so usage of the [`write`]
278+
/// and [`format`] functions can be safely performed.
279+
///
280+
/// [`format_args!`]: ../../std/macro.format_args.html
281+
/// [`format`]: ../../std/fmt/fn.format.html
282+
/// [`write`]: ../../std/fmt/fn.write.html
279283
#[stable(feature = "rust1", since = "1.0.0")]
280284
#[derive(Copy, Clone)]
281285
pub struct Arguments<'a> {

src/libstd/macros.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,18 @@ macro_rules! assert_approx_eq {
193193
pub mod builtin {
194194
/// The core macro for formatted string creation & output.
195195
///
196-
/// This macro produces a value of type `fmt::Arguments`. This value can be
197-
/// passed to the functions in `std::fmt` for performing useful functions.
198-
/// All other formatting macros (`format!`, `write!`, `println!`, etc) are
196+
/// This macro produces a value of type [`fmt::Arguments`]. This value can be
197+
/// passed to the functions in [`std::fmt`] for performing useful functions.
198+
/// All other formatting macros ([`format!`], [`write!`], [`println!`], etc) are
199199
/// proxied through this one.
200200
///
201-
/// For more information, see the documentation in `std::fmt`.
201+
/// For more information, see the documentation in [`std::fmt`].
202+
///
203+
/// [`fmt::Arguments`]: ../std/fmt/struct.Arguments.html
204+
/// [`std::fmt`]: ../std/fmt/index.html
205+
/// [`format!`]: ../std/macro.format.html
206+
/// [`write!`]: ../std/macro.write.html
207+
/// [`println!`]: ../std/macro.println.html
202208
///
203209
/// # Examples
204210
///

0 commit comments

Comments
 (0)