Rollup merge of #87618 - GuillaumeGomez:std-char-types-doc, r=jyn514,camelid

Add missing documentation for std::char types
This commit is contained in:
Dylan DPC 2022-03-11 20:29:42 +01:00 committed by GitHub
commit 85056107fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,6 +218,8 @@ fn from(i: u8) -> Self {
} }
/// An error which can be returned when parsing a char. /// An error which can be returned when parsing a char.
///
/// This `struct` is created when using the [`char::from_str`] method.
#[stable(feature = "char_from_str", since = "1.20.0")] #[stable(feature = "char_from_str", since = "1.20.0")]
#[derive(Clone, Debug, PartialEq, Eq)] #[derive(Clone, Debug, PartialEq, Eq)]
pub struct ParseCharError { pub struct ParseCharError {
@ -300,7 +302,10 @@ fn try_from(i: u32) -> Result<Self, Self::Error> {
} }
} }
/// The error type returned when a conversion from u32 to char fails. /// The error type returned when a conversion from [`prim@u32`] to [`prim@char`] fails.
///
/// This `struct` is created by the [`char::try_from<u32>`](char#impl-TryFrom<u32>) method.
/// See its documentation for more.
#[stable(feature = "try_from", since = "1.34.0")] #[stable(feature = "try_from", since = "1.34.0")]
#[derive(Copy, Clone, Debug, PartialEq, Eq)] #[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct CharTryFromError(()); pub struct CharTryFromError(());