about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-03-09 23:14:10 +0100
committerGitHub <noreply@github.com>2022-03-09 23:14:10 +0100
commit2567d0f8837d351beba9c30545833fdf4bdc7054 (patch)
tree73c385eb0b831a21e992563747d94fa9f782927f
parentc0259626b6036a886f10c40b85f2d1b36118aeb9 (diff)
parent9054fbb03ab2ebb048888f4963a364d800fba056 (diff)
downloadrust-2567d0f8837d351beba9c30545833fdf4bdc7054.tar.gz
rust-2567d0f8837d351beba9c30545833fdf4bdc7054.zip
Rollup merge of #92541 - asquared31415:from-docs, r=m-ou-se
Mention intent of `From` trait in its docs

This pr is a docs modification to add to the documentation of the `From` trait a note about its intent as a perfect conversion.  This is already stated in the `TryFrom` docs so this is simply adding that information in a more visible way.
-rw-r--r--library/core/src/convert/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs
index b911bbc3574..f5ea5f5ba50 100644
--- a/library/core/src/convert/mod.rs
+++ b/library/core/src/convert/mod.rs
@@ -300,7 +300,8 @@ pub trait Into<T>: Sized {
 /// that encapsulate multiple error types. See the "Examples" section and [the book][book] for more
 /// details.
 ///
-/// **Note: This trait must not fail**. If the conversion can fail, use [`TryFrom`].
+/// **Note: This trait must not fail**. The `From` trait is intended for perfect conversions.
+/// If the conversion can fail or is not perfect, use [`TryFrom`].
 ///
 /// # Generic Implementations
 ///