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;
@@ -3595,20 +3595,12 @@ impl fmt::Display for TryFromIntError {
35953595 }
35963596}
35973597
3598- #[ unstable( feature = "try_from" , issue = "33417" ) ]
3599- impl From < Infallible > for TryFromIntError {
3600- fn from ( infallible : Infallible ) -> TryFromIntError {
3601- match infallible {
3602- }
3603- }
3604- }
3605-
36063598// no possible bounds violation
36073599macro_rules! try_from_unbounded {
36083600 ( $source: ty, $( $target: ty) ,* ) => { $(
36093601 #[ unstable( feature = "try_from" , issue = "33417" ) ]
36103602 impl TryFrom <$source> for $target {
3611- type Error = Infallible ;
3603+ type Error = ! ;
36123604
36133605 #[ inline]
36143606 fn try_from( value: $source) -> Result <Self , Self :: Error > {
@@ -3719,7 +3711,7 @@ try_from_lower_bounded!(isize, usize);
37193711#[ cfg( target_pointer_width = "16" ) ]
37203712mod ptr_try_from_impls {
37213713 use super :: TryFromIntError ;
3722- use convert:: { Infallible , TryFrom } ;
3714+ use convert:: TryFrom ;
37233715
37243716 try_from_upper_bounded ! ( usize , u8 ) ;
37253717 try_from_unbounded ! ( usize , u16 , u32 , u64 , u128 ) ;
@@ -3745,7 +3737,7 @@ mod ptr_try_from_impls {
37453737#[ cfg( target_pointer_width = "32" ) ]
37463738mod ptr_try_from_impls {
37473739 use super :: TryFromIntError ;
3748- use convert:: { Infallible , TryFrom } ;
3740+ use convert:: TryFrom ;
37493741
37503742 try_from_upper_bounded ! ( usize , u8 , u16 ) ;
37513743 try_from_unbounded ! ( usize , u32 , u64 , u128 ) ;
@@ -3771,7 +3763,7 @@ mod ptr_try_from_impls {
37713763#[ cfg( target_pointer_width = "64" ) ]
37723764mod ptr_try_from_impls {
37733765 use super :: TryFromIntError ;
3774- use convert:: { Infallible , TryFrom } ;
3766+ use convert:: TryFrom ;
37753767
37763768 try_from_upper_bounded ! ( usize , u8 , u16 , u32 ) ;
37773769 try_from_unbounded ! ( usize , u64 , u128 ) ;
0 commit comments