@@ -45,8 +45,10 @@ impl_float_to_int!(f64 => u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize);
4545macro_rules! impl_from {
4646 ( $Small: ty, $Large: ty, #[ $attr: meta] , $doc: expr) => {
4747 #[ $attr]
48- #[ doc = $doc]
4948 impl From <$Small> for $Large {
49+ // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
50+ // Rustdocs on functions do not.
51+ #[ doc = $doc]
5052 #[ inline]
5153 fn from( small: $Small) -> Self {
5254 small as Self
@@ -383,8 +385,10 @@ use crate::num::NonZeroUsize;
383385macro_rules! nzint_impl_from {
384386 ( $Small: ty, $Large: ty, #[ $attr: meta] , $doc: expr) => {
385387 #[ $attr]
386- #[ doc = $doc]
387388 impl From <$Small> for $Large {
389+ // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
390+ // Rustdocs on functions do not.
391+ #[ doc = $doc]
388392 #[ inline]
389393 fn from( small: $Small) -> Self {
390394 // SAFETY: input type guarantees the value is non-zero
@@ -450,10 +454,12 @@ nzint_impl_from! { NonZeroU64, NonZeroI128, #[stable(feature = "nz_int_conv", si
450454macro_rules! nzint_impl_try_from_int {
451455 ( $Int: ty, $NonZeroInt: ty, #[ $attr: meta] , $doc: expr) => {
452456 #[ $attr]
453- #[ doc = $doc]
454457 impl TryFrom <$Int> for $NonZeroInt {
455458 type Error = TryFromIntError ;
456459
460+ // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
461+ // Rustdocs on functions do not.
462+ #[ doc = $doc]
457463 #[ inline]
458464 fn try_from( value: $Int) -> Result <Self , Self :: Error > {
459465 Self :: new( value) . ok_or( TryFromIntError ( ( ) ) )
@@ -489,10 +495,12 @@ nzint_impl_try_from_int! { isize, NonZeroIsize, #[stable(feature = "nzint_try_fr
489495macro_rules! nzint_impl_try_from_nzint {
490496 ( $From: ty => $To: ty, $doc: expr) => {
491497 #[ stable( feature = "nzint_try_from_nzint_conv" , since = "1.49.0" ) ]
492- #[ doc = $doc]
493498 impl TryFrom <$From> for $To {
494499 type Error = TryFromIntError ;
495500
501+ // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
502+ // Rustdocs on functions do not.
503+ #[ doc = $doc]
496504 #[ inline]
497505 fn try_from( value: $From) -> Result <Self , Self :: Error > {
498506 TryFrom :: try_from( value. get( ) ) . map( |v| {
0 commit comments