@@ -430,6 +430,8 @@ macro_rules! nzint_impl_from {
430
430
}
431
431
}
432
432
}
433
+
434
+ impl_from_ref! { $Small, $Large }
433
435
} ;
434
436
( $Small: ty, $Large: ty, #[ $attr: meta] ) => {
435
437
nzint_impl_from!( $Small,
@@ -444,31 +446,39 @@ macro_rules! nzint_impl_from {
444
446
}
445
447
446
448
// Non-zero Unsigned -> Non-zero Unsigned
449
+ impl_from_ref ! { NonZeroU8 , NonZeroU8 }
447
450
nzint_impl_from ! { NonZeroU8 , NonZeroU16 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
448
451
nzint_impl_from ! { NonZeroU8 , NonZeroU32 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
449
452
nzint_impl_from ! { NonZeroU8 , NonZeroU64 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
450
453
nzint_impl_from ! { NonZeroU8 , NonZeroU128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
451
454
nzint_impl_from ! { NonZeroU8 , NonZeroUsize , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
455
+ impl_from_ref ! { NonZeroU16 , NonZeroU16 }
452
456
nzint_impl_from ! { NonZeroU16 , NonZeroU32 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
453
457
nzint_impl_from ! { NonZeroU16 , NonZeroU64 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
454
458
nzint_impl_from ! { NonZeroU16 , NonZeroU128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
455
459
nzint_impl_from ! { NonZeroU16 , NonZeroUsize , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
460
+ impl_from_ref ! { NonZeroU32 , NonZeroU32 }
456
461
nzint_impl_from ! { NonZeroU32 , NonZeroU64 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
457
462
nzint_impl_from ! { NonZeroU32 , NonZeroU128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
463
+ impl_from_ref ! { NonZeroU64 , NonZeroU64 }
458
464
nzint_impl_from ! { NonZeroU64 , NonZeroU128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
459
465
460
466
// Non-zero Signed -> Non-zero Signed
467
+ impl_from_ref ! { NonZeroI8 , NonZeroI8 }
461
468
nzint_impl_from ! { NonZeroI8 , NonZeroI16 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
462
469
nzint_impl_from ! { NonZeroI8 , NonZeroI32 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
463
470
nzint_impl_from ! { NonZeroI8 , NonZeroI64 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
464
471
nzint_impl_from ! { NonZeroI8 , NonZeroI128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
465
472
nzint_impl_from ! { NonZeroI8 , NonZeroIsize , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
473
+ impl_from_ref ! { NonZeroI16 , NonZeroI16 }
466
474
nzint_impl_from ! { NonZeroI16 , NonZeroI32 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
467
475
nzint_impl_from ! { NonZeroI16 , NonZeroI64 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
468
476
nzint_impl_from ! { NonZeroI16 , NonZeroI128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
469
477
nzint_impl_from ! { NonZeroI16 , NonZeroIsize , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
478
+ impl_from_ref ! { NonZeroI32 , NonZeroI32 }
470
479
nzint_impl_from ! { NonZeroI32 , NonZeroI64 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
471
480
nzint_impl_from ! { NonZeroI32 , NonZeroI128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
481
+ impl_from_ref ! { NonZeroI64 , NonZeroI64 }
472
482
nzint_impl_from ! { NonZeroI64 , NonZeroI128 , #[ stable( feature = "nz_int_conv" , since = "1.41.0" ) ] }
473
483
474
484
// NonZero UnSigned -> Non-zero Signed
0 commit comments