diff --git a/library/core/src/convert/num.rs b/library/core/src/convert/num.rs index 64e429b2f2591..c0d8fd670d7ad 100644 --- a/library/core/src/convert/num.rs +++ b/library/core/src/convert/num.rs @@ -336,8 +336,7 @@ macro_rules! impl_try_from_unbounded { type Error = TryFromIntError; /// Tries to create the target number type from a source - /// number type. This returns an error if the source value - /// is outside of the range of the target type. + /// number type. This never returns an error. #[inline] fn try_from(value: $source) -> Result { Ok(value as Self) @@ -356,7 +355,7 @@ macro_rules! impl_try_from_lower_bounded { /// Tries to create the target number type from a source /// number type. This returns an error if the source value - /// is outside of the range of the target type. + #[doc = concat!("is less than [`", stringify!($target), "::MIN`].")] #[inline] fn try_from(u: $source) -> Result { if u >= 0 { @@ -379,7 +378,7 @@ macro_rules! impl_try_from_upper_bounded { /// Tries to create the target number type from a source /// number type. This returns an error if the source value - /// is outside of the range of the target type. + #[doc = concat!("is greater than [`", stringify!($target), "::MAX`].")] #[inline] fn try_from(u: $source) -> Result { if u > (Self::MAX as $source) {