1212
1313#![ stable( feature = "rust1" , since = "1.0.0" ) ]
1414
15- use convert:: { Infallible , TryFrom } ;
15+ use convert:: TryFrom ;
1616use fmt;
1717use intrinsics;
1818use ops;
@@ -3596,10 +3596,9 @@ impl fmt::Display for TryFromIntError {
35963596}
35973597
35983598#[ 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
36033602 }
36043603}
36053604
@@ -3608,7 +3607,7 @@ macro_rules! try_from_unbounded {
36083607 ( $source: ty, $( $target: ty) ,* ) => { $(
36093608 #[ unstable( feature = "try_from" , issue = "33417" ) ]
36103609 impl TryFrom <$source> for $target {
3611- type Error = Infallible ;
3610+ type Error = ! ;
36123611
36133612 #[ inline]
36143613 fn try_from( value: $source) -> Result <Self , Self :: Error > {
@@ -3719,7 +3718,7 @@ try_from_lower_bounded!(isize, usize);
37193718#[ cfg( target_pointer_width = "16" ) ]
37203719mod ptr_try_from_impls {
37213720 use super :: TryFromIntError ;
3722- use convert:: { Infallible , TryFrom } ;
3721+ use convert:: TryFrom ;
37233722
37243723 try_from_upper_bounded ! ( usize , u8 ) ;
37253724 try_from_unbounded ! ( usize , u16 , u32 , u64 , u128 ) ;
@@ -3745,7 +3744,7 @@ mod ptr_try_from_impls {
37453744#[ cfg( target_pointer_width = "32" ) ]
37463745mod ptr_try_from_impls {
37473746 use super :: TryFromIntError ;
3748- use convert:: { Infallible , TryFrom } ;
3747+ use convert:: TryFrom ;
37493748
37503749 try_from_upper_bounded ! ( usize , u8 , u16 ) ;
37513750 try_from_unbounded ! ( usize , u32 , u64 , u128 ) ;
@@ -3771,7 +3770,7 @@ mod ptr_try_from_impls {
37713770#[ cfg( target_pointer_width = "64" ) ]
37723771mod ptr_try_from_impls {
37733772 use super :: TryFromIntError ;
3774- use convert:: { Infallible , TryFrom } ;
3773+ use convert:: TryFrom ;
37753774
37763775 try_from_upper_bounded ! ( usize , u8 , u16 , u32 ) ;
37773776 try_from_unbounded ! ( usize , u64 , u128 ) ;
0 commit comments