@@ -45,8 +45,10 @@ impl_float_to_int!(f64 => u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize);
45
45
macro_rules! impl_from {
46
46
( $Small: ty, $Large: ty, #[ $attr: meta] , $doc: expr) => {
47
47
#[ $attr]
48
- #[ doc = $doc]
49
48
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]
50
52
#[ inline]
51
53
fn from( small: $Small) -> Self {
52
54
small as Self
@@ -383,8 +385,10 @@ use crate::num::NonZeroUsize;
383
385
macro_rules! nzint_impl_from {
384
386
( $Small: ty, $Large: ty, #[ $attr: meta] , $doc: expr) => {
385
387
#[ $attr]
386
- #[ doc = $doc]
387
388
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]
388
392
#[ inline]
389
393
fn from( small: $Small) -> Self {
390
394
// SAFETY: input type guarantees the value is non-zero
@@ -450,10 +454,12 @@ nzint_impl_from! { NonZeroU64, NonZeroI128, #[stable(feature = "nz_int_conv", si
450
454
macro_rules! nzint_impl_try_from_int {
451
455
( $Int: ty, $NonZeroInt: ty, #[ $attr: meta] , $doc: expr) => {
452
456
#[ $attr]
453
- #[ doc = $doc]
454
457
impl TryFrom <$Int> for $NonZeroInt {
455
458
type Error = TryFromIntError ;
456
459
460
+ // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
461
+ // Rustdocs on functions do not.
462
+ #[ doc = $doc]
457
463
#[ inline]
458
464
fn try_from( value: $Int) -> Result <Self , Self :: Error > {
459
465
Self :: new( value) . ok_or( TryFromIntError ( ( ) ) )
@@ -489,10 +495,12 @@ nzint_impl_try_from_int! { isize, NonZeroIsize, #[stable(feature = "nzint_try_fr
489
495
macro_rules! nzint_impl_try_from_nzint {
490
496
( $From: ty => $To: ty, $doc: expr) => {
491
497
#[ stable( feature = "nzint_try_from_nzint_conv" , since = "1.49.0" ) ]
492
- #[ doc = $doc]
493
498
impl TryFrom <$From> for $To {
494
499
type Error = TryFromIntError ;
495
500
501
+ // Rustdocs on the impl block show a "[+] show undocumented items" toggle.
502
+ // Rustdocs on functions do not.
503
+ #[ doc = $doc]
496
504
#[ inline]
497
505
fn try_from( value: $From) -> Result <Self , Self :: Error > {
498
506
TryFrom :: try_from( value. get( ) ) . map( |v| {
0 commit comments