@@ -20,7 +20,6 @@ use self::wrapping::{OverflowingOps, WrappingOps};
20
20
use char:: CharExt ;
21
21
use clone:: Clone ;
22
22
use cmp:: { PartialEq , Eq , PartialOrd , Ord } ;
23
- use error:: Error ;
24
23
use fmt;
25
24
use intrinsics;
26
25
use iter:: Iterator ;
@@ -2948,16 +2947,9 @@ enum IntErrorKind {
2948
2947
Underflow ,
2949
2948
}
2950
2949
2951
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2952
- impl fmt:: Display for ParseIntError {
2953
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2954
- self . description ( ) . fmt ( f)
2955
- }
2956
- }
2957
-
2958
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2959
- impl Error for ParseIntError {
2960
- fn description ( & self ) -> & str {
2950
+ impl ParseIntError {
2951
+ #[ unstable( feature = "core" , reason = "available through Error trait" ) ]
2952
+ pub fn description ( & self ) -> & str {
2961
2953
match self . kind {
2962
2954
IntErrorKind :: Empty => "cannot parse integer from empty string" ,
2963
2955
IntErrorKind :: InvalidDigit => "invalid digit found in string" ,
@@ -2967,6 +2959,13 @@ impl Error for ParseIntError {
2967
2959
}
2968
2960
}
2969
2961
2962
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2963
+ impl fmt:: Display for ParseIntError {
2964
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2965
+ self . description ( ) . fmt ( f)
2966
+ }
2967
+ }
2968
+
2970
2969
/// An error which can be returned when parsing a float.
2971
2970
#[ derive( Debug , Clone , PartialEq ) ]
2972
2971
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -2978,19 +2977,19 @@ enum FloatErrorKind {
2978
2977
Invalid ,
2979
2978
}
2980
2979
2981
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2982
- impl fmt:: Display for ParseFloatError {
2983
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2984
- self . description ( ) . fmt ( f)
2985
- }
2986
- }
2987
-
2988
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2989
- impl Error for ParseFloatError {
2990
- fn description ( & self ) -> & str {
2980
+ impl ParseFloatError {
2981
+ #[ unstable( feature = "core" , reason = "available through Error trait" ) ]
2982
+ pub fn description ( & self ) -> & str {
2991
2983
match self . kind {
2992
2984
FloatErrorKind :: Empty => "cannot parse float from empty string" ,
2993
2985
FloatErrorKind :: Invalid => "invalid float literal" ,
2994
2986
}
2995
2987
}
2996
2988
}
2989
+
2990
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2991
+ impl fmt:: Display for ParseFloatError {
2992
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
2993
+ self . description ( ) . fmt ( f)
2994
+ }
2995
+ }
0 commit comments