12
12
13
13
#![ stable( feature = "rust1" , since = "1.0.0" ) ]
14
14
15
- use convert:: { Infallible , TryFrom } ;
15
+ use convert:: TryFrom ;
16
16
use fmt;
17
17
use intrinsics;
18
18
use ops;
@@ -3596,10 +3596,9 @@ impl fmt::Display for TryFromIntError {
3596
3596
}
3597
3597
3598
3598
#[ unstable( feature = "try_from" , issue = "33417" ) ]
3599
- impl From < Infallible > for TryFromIntError {
3600
- fn from ( infallible : Infallible ) -> TryFromIntError {
3601
- match infallible {
3602
- }
3599
+ impl From < !> for TryFromIntError {
3600
+ fn from ( never : !) -> TryFromIntError {
3601
+ never
3603
3602
}
3604
3603
}
3605
3604
@@ -3608,7 +3607,7 @@ macro_rules! try_from_unbounded {
3608
3607
( $source: ty, $( $target: ty) ,* ) => { $(
3609
3608
#[ unstable( feature = "try_from" , issue = "33417" ) ]
3610
3609
impl TryFrom <$source> for $target {
3611
- type Error = Infallible ;
3610
+ type Error = ! ;
3612
3611
3613
3612
#[ inline]
3614
3613
fn try_from( value: $source) -> Result <Self , Self :: Error > {
@@ -3719,7 +3718,7 @@ try_from_lower_bounded!(isize, usize);
3719
3718
#[ cfg( target_pointer_width = "16" ) ]
3720
3719
mod ptr_try_from_impls {
3721
3720
use super :: TryFromIntError ;
3722
- use convert:: { Infallible , TryFrom } ;
3721
+ use convert:: TryFrom ;
3723
3722
3724
3723
try_from_upper_bounded ! ( usize , u8 ) ;
3725
3724
try_from_unbounded ! ( usize , u16 , u32 , u64 , u128 ) ;
@@ -3745,7 +3744,7 @@ mod ptr_try_from_impls {
3745
3744
#[ cfg( target_pointer_width = "32" ) ]
3746
3745
mod ptr_try_from_impls {
3747
3746
use super :: TryFromIntError ;
3748
- use convert:: { Infallible , TryFrom } ;
3747
+ use convert:: TryFrom ;
3749
3748
3750
3749
try_from_upper_bounded ! ( usize , u8 , u16 ) ;
3751
3750
try_from_unbounded ! ( usize , u32 , u64 , u128 ) ;
@@ -3771,7 +3770,7 @@ mod ptr_try_from_impls {
3771
3770
#[ cfg( target_pointer_width = "64" ) ]
3772
3771
mod ptr_try_from_impls {
3773
3772
use super :: TryFromIntError ;
3774
- use convert:: { Infallible , TryFrom } ;
3773
+ use convert:: TryFrom ;
3775
3774
3776
3775
try_from_upper_bounded ! ( usize , u8 , u16 , u32 ) ;
3777
3776
try_from_unbounded ! ( usize , u64 , u128 ) ;
0 commit comments