Skip to content

Commit

Permalink
Rollup merge of rust-lang#102322 - sigaloid:master, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Document that Display automatically implements ToString

Closes rust-lang#92941

r? rust-lang/docs
  • Loading branch information
notriddle authored Sep 26, 2022
2 parents a97f73c + 4fad063 commit 6e8cbe2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,12 +709,19 @@ pub use macros::Debug;

/// Format trait for an empty format, `{}`.
///
/// Implementing this trait for a type will automatically implement the
/// [`ToString`][tostring] trait for the type, allowing the usage
/// of the [`.to_string()`][tostring_function] method. Prefer implementing
/// the `Display` trait for a type, rather than [`ToString`][tostring].
///
/// `Display` is similar to [`Debug`], but `Display` is for user-facing
/// output, and so cannot be derived.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// [tostring]: ../../std/string/trait.ToString.html
/// [tostring_function]: ../../std/string/trait.ToString.html#tymethod.to_string
///
/// # Examples
///
Expand Down

0 comments on commit 6e8cbe2

Please sign in to comment.