Rollup merge of #102322 - sigaloid:master, r=GuillaumeGomez

Document that Display automatically implements ToString

Closes #92941

r? rust-lang/docs
This commit is contained in:
Michael Howell 2022-09-26 15:40:54 -07:00 committed by GitHub
commit 66bab6b781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
///