@@ -5257,13 +5257,9 @@ macro_rules! nzint_impl_from {
5257
5257
#[ $attr]
5258
5258
#[ doc = $doc]
5259
5259
impl From <$Small> for $Large {
5260
- /// Widens a non-zero integer without checking the value is zero.
5261
- ///
5262
- /// # Safety
5263
- ///
5264
- /// The value is assumed to be non-zero.
5265
5260
#[ inline]
5266
5261
fn from( small: $Small) -> $Large {
5262
+ // SAFETY: input type guarantees the value is non-zero
5267
5263
unsafe {
5268
5264
<$Large>:: new_unchecked( small. get( ) . into( ) )
5269
5265
}
@@ -5283,40 +5279,40 @@ macro_rules! nzint_impl_from {
5283
5279
}
5284
5280
5285
5281
// Non-zero Unsigned -> Non-zero Unsigned
5286
- nzint_impl_from ! { NonZeroU8 , NonZeroU16 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5287
- nzint_impl_from ! { NonZeroU8 , NonZeroU32 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5288
- nzint_impl_from ! { NonZeroU8 , NonZeroU64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5289
- nzint_impl_from ! { NonZeroU8 , NonZeroU128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5290
- nzint_impl_from ! { NonZeroU8 , NonZeroUsize , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5291
- nzint_impl_from ! { NonZeroU16 , NonZeroU32 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5292
- nzint_impl_from ! { NonZeroU16 , NonZeroU64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5293
- nzint_impl_from ! { NonZeroU16 , NonZeroU128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5294
- nzint_impl_from ! { NonZeroU32 , NonZeroU64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5295
- nzint_impl_from ! { NonZeroU32 , NonZeroU128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5296
- nzint_impl_from ! { NonZeroU64 , NonZeroU128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5282
+ nzint_impl_from ! { NonZeroU8 , NonZeroU16 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5283
+ nzint_impl_from ! { NonZeroU8 , NonZeroU32 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5284
+ nzint_impl_from ! { NonZeroU8 , NonZeroU64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5285
+ nzint_impl_from ! { NonZeroU8 , NonZeroU128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5286
+ nzint_impl_from ! { NonZeroU8 , NonZeroUsize , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5287
+ nzint_impl_from ! { NonZeroU16 , NonZeroU32 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5288
+ nzint_impl_from ! { NonZeroU16 , NonZeroU64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5289
+ nzint_impl_from ! { NonZeroU16 , NonZeroU128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5290
+ nzint_impl_from ! { NonZeroU32 , NonZeroU64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5291
+ nzint_impl_from ! { NonZeroU32 , NonZeroU128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5292
+ nzint_impl_from ! { NonZeroU64 , NonZeroU128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5297
5293
5298
5294
// Non-zero Signed -> Non-zero Signed
5299
- nzint_impl_from ! { NonZeroI8 , NonZeroI16 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5300
- nzint_impl_from ! { NonZeroI8 , NonZeroI32 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5301
- nzint_impl_from ! { NonZeroI8 , NonZeroI64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5302
- nzint_impl_from ! { NonZeroI8 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5303
- nzint_impl_from ! { NonZeroI8 , NonZeroIsize , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5304
- nzint_impl_from ! { NonZeroI16 , NonZeroI32 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5305
- nzint_impl_from ! { NonZeroI16 , NonZeroI64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5306
- nzint_impl_from ! { NonZeroI16 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5307
- nzint_impl_from ! { NonZeroI32 , NonZeroI64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5308
- nzint_impl_from ! { NonZeroI32 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5309
- nzint_impl_from ! { NonZeroI64 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5295
+ nzint_impl_from ! { NonZeroI8 , NonZeroI16 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5296
+ nzint_impl_from ! { NonZeroI8 , NonZeroI32 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5297
+ nzint_impl_from ! { NonZeroI8 , NonZeroI64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5298
+ nzint_impl_from ! { NonZeroI8 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5299
+ nzint_impl_from ! { NonZeroI8 , NonZeroIsize , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5300
+ nzint_impl_from ! { NonZeroI16 , NonZeroI32 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5301
+ nzint_impl_from ! { NonZeroI16 , NonZeroI64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5302
+ nzint_impl_from ! { NonZeroI16 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5303
+ nzint_impl_from ! { NonZeroI32 , NonZeroI64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5304
+ nzint_impl_from ! { NonZeroI32 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5305
+ nzint_impl_from ! { NonZeroI64 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5310
5306
5311
5307
// NonZero UnSigned -> Non-zero Signed
5312
- nzint_impl_from ! { NonZeroU8 , NonZeroI16 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5313
- nzint_impl_from ! { NonZeroU8 , NonZeroI32 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5314
- nzint_impl_from ! { NonZeroU8 , NonZeroI64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5315
- nzint_impl_from ! { NonZeroU8 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5316
- nzint_impl_from ! { NonZeroU8 , NonZeroIsize , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5317
- nzint_impl_from ! { NonZeroU16 , NonZeroI32 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5318
- nzint_impl_from ! { NonZeroU16 , NonZeroI64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5319
- nzint_impl_from ! { NonZeroU16 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5320
- nzint_impl_from ! { NonZeroU32 , NonZeroI64 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5321
- nzint_impl_from ! { NonZeroU32 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5322
- nzint_impl_from ! { NonZeroU64 , NonZeroI128 , #[ unstable( feature = "lossless_non_zero_int_conv " , issue = "66196" ) ] }
5308
+ nzint_impl_from ! { NonZeroU8 , NonZeroI16 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5309
+ nzint_impl_from ! { NonZeroU8 , NonZeroI32 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5310
+ nzint_impl_from ! { NonZeroU8 , NonZeroI64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5311
+ nzint_impl_from ! { NonZeroU8 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5312
+ nzint_impl_from ! { NonZeroU8 , NonZeroIsize , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5313
+ nzint_impl_from ! { NonZeroU16 , NonZeroI32 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5314
+ nzint_impl_from ! { NonZeroU16 , NonZeroI64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5315
+ nzint_impl_from ! { NonZeroU16 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5316
+ nzint_impl_from ! { NonZeroU32 , NonZeroI64 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5317
+ nzint_impl_from ! { NonZeroU32 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
5318
+ nzint_impl_from ! { NonZeroU64 , NonZeroI128 , #[ unstable( feature = "nz_int_conv " , issue = "66196" ) ] }
0 commit comments