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;
@@ -3595,20 +3595,12 @@ impl fmt::Display for TryFromIntError {
3595
3595
}
3596
3596
}
3597
3597
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
-
3606
3598
// no possible bounds violation
3607
3599
macro_rules! try_from_unbounded {
3608
3600
( $source: ty, $( $target: ty) ,* ) => { $(
3609
3601
#[ unstable( feature = "try_from" , issue = "33417" ) ]
3610
3602
impl TryFrom <$source> for $target {
3611
- type Error = Infallible ;
3603
+ type Error = ! ;
3612
3604
3613
3605
#[ inline]
3614
3606
fn try_from( value: $source) -> Result <Self , Self :: Error > {
@@ -3719,7 +3711,7 @@ try_from_lower_bounded!(isize, usize);
3719
3711
#[ cfg( target_pointer_width = "16" ) ]
3720
3712
mod ptr_try_from_impls {
3721
3713
use super :: TryFromIntError ;
3722
- use convert:: { Infallible , TryFrom } ;
3714
+ use convert:: TryFrom ;
3723
3715
3724
3716
try_from_upper_bounded ! ( usize , u8 ) ;
3725
3717
try_from_unbounded ! ( usize , u16 , u32 , u64 , u128 ) ;
@@ -3745,7 +3737,7 @@ mod ptr_try_from_impls {
3745
3737
#[ cfg( target_pointer_width = "32" ) ]
3746
3738
mod ptr_try_from_impls {
3747
3739
use super :: TryFromIntError ;
3748
- use convert:: { Infallible , TryFrom } ;
3740
+ use convert:: TryFrom ;
3749
3741
3750
3742
try_from_upper_bounded ! ( usize , u8 , u16 ) ;
3751
3743
try_from_unbounded ! ( usize , u32 , u64 , u128 ) ;
@@ -3771,7 +3763,7 @@ mod ptr_try_from_impls {
3771
3763
#[ cfg( target_pointer_width = "64" ) ]
3772
3764
mod ptr_try_from_impls {
3773
3765
use super :: TryFromIntError ;
3774
- use convert:: { Infallible , TryFrom } ;
3766
+ use convert:: TryFrom ;
3775
3767
3776
3768
try_from_upper_bounded ! ( usize , u8 , u16 , u32 ) ;
3777
3769
try_from_unbounded ! ( usize , u64 , u128 ) ;
0 commit comments