@@ -910,12 +910,12 @@ impl_to_primitive_uint! { u32 }
910910impl_to_primitive_uint ! { u64 }
911911
912912macro_rules! impl_to_primitive_float_to_float {
913- ( $SrcT: ty , $DstT: ty , $slf: expr) => (
913+ ( $SrcT: ident , $DstT: ident , $slf: expr) => (
914914 if size_of:: <$SrcT>( ) <= size_of:: <$DstT>( ) {
915915 Some ( $slf as $DstT)
916916 } else {
917917 let n = $slf as f64 ;
918- let max_value: $SrcT = Float :: max_value ( ) ;
918+ let max_value: $SrcT = :: $SrcT :: MAX_VALUE ;
919919 if -max_value as f64 <= n && n <= max_value as f64 {
920920 Some ( $slf as $DstT)
921921 } else {
@@ -926,7 +926,7 @@ macro_rules! impl_to_primitive_float_to_float {
926926}
927927
928928macro_rules! impl_to_primitive_float {
929- ( $T: ty ) => (
929+ ( $T: ident ) => (
930930 impl ToPrimitive for $T {
931931 #[ inline]
932932 fn to_int( & self ) -> Option <int> { Some ( * self as int) }
@@ -1251,24 +1251,34 @@ pub trait Float
12511251 // FIXME (#5527): These should be associated constants
12521252
12531253 /// Returns the number of binary digits of mantissa that this type supports.
1254+ #[ deprecated = "use `std::f32::MANTISSA_DIGITS` or `std::f64::MANTISSA_DIGITS` as appropriate" ]
12541255 fn mantissa_digits ( unused_self : Option < Self > ) -> uint ;
12551256 /// Returns the number of base-10 digits of precision that this type supports.
1257+ #[ deprecated = "use `std::f32::DIGITS` or `std::f64::DIGITS` as appropriate" ]
12561258 fn digits ( unused_self : Option < Self > ) -> uint ;
12571259 /// Returns the difference between 1.0 and the smallest representable number larger than 1.0.
1260+ #[ deprecated = "use `std::f32::EPSILON` or `std::f64::EPSILON` as appropriate" ]
12581261 fn epsilon ( ) -> Self ;
12591262 /// Returns the minimum binary exponent that this type can represent.
1263+ #[ deprecated = "use `std::f32::MIN_EXP` or `std::f64::MIN_EXP` as appropriate" ]
12601264 fn min_exp ( unused_self : Option < Self > ) -> int ;
12611265 /// Returns the maximum binary exponent that this type can represent.
1266+ #[ deprecated = "use `std::f32::MAX_EXP` or `std::f64::MAX_EXP` as appropriate" ]
12621267 fn max_exp ( unused_self : Option < Self > ) -> int ;
12631268 /// Returns the minimum base-10 exponent that this type can represent.
1269+ #[ deprecated = "use `std::f32::MIN_10_EXP` or `std::f64::MIN_10_EXP` as appropriate" ]
12641270 fn min_10_exp ( unused_self : Option < Self > ) -> int ;
12651271 /// Returns the maximum base-10 exponent that this type can represent.
1272+ #[ deprecated = "use `std::f32::MAX_10_EXP` or `std::f64::MAX_10_EXP` as appropriate" ]
12661273 fn max_10_exp ( unused_self : Option < Self > ) -> int ;
12671274 /// Returns the smallest finite value that this type can represent.
1275+ #[ deprecated = "use `std::f32::MIN_VALUE` or `std::f64::MIN_VALUE` as appropriate" ]
12681276 fn min_value ( ) -> Self ;
12691277 /// Returns the smallest normalized positive number that this type can represent.
1278+ #[ deprecated = "use `std::f32::MIN_POS_VALUE` or `std::f64::MIN_POS_VALUE` as appropriate" ]
12701279 fn min_pos_value ( unused_self : Option < Self > ) -> Self ;
12711280 /// Returns the largest finite value that this type can represent.
1281+ #[ deprecated = "use `std::f32::MAX_VALUE` or `std::f64::MAX_VALUE` as appropriate" ]
12721282 fn max_value ( ) -> Self ;
12731283
12741284 /// Returns true if this value is NaN and false otherwise.
0 commit comments