@@ -524,15 +524,6 @@ impl f32 {
524524 self != self
525525 }
526526
527- // FIXME(#50145): `abs` is publicly unavailable in core due to
528- // concerns about portability, so this implementation is for
529- // private use internally.
530- #[ inline]
531- pub ( crate ) const fn abs_private ( self ) -> f32 {
532- // SAFETY: This transmutation is fine just like in `to_bits`/`from_bits`.
533- unsafe { mem:: transmute :: < u32 , f32 > ( mem:: transmute :: < f32 , u32 > ( self ) & !Self :: SIGN_MASK ) }
534- }
535-
536527 /// Returns `true` if this value is positive infinity or negative infinity, and
537528 /// `false` otherwise.
538529 ///
@@ -577,10 +568,11 @@ impl f32 {
577568 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
578569 #[ rustc_const_stable( feature = "const_float_classify" , since = "1.83.0" ) ]
579570 #[ inline]
571+ #[ rustc_allow_const_fn_unstable( const_float_methods) ] // for `abs`
580572 pub const fn is_finite ( self ) -> bool {
581573 // There's no need to handle NaN separately: if self is NaN,
582574 // the comparison is not true, exactly as desired.
583- self . abs_private ( ) < Self :: INFINITY
575+ self . abs ( ) < Self :: INFINITY
584576 }
585577
586578 /// Returns `true` if the number is [subnormal].
@@ -1020,8 +1012,8 @@ impl f32 {
10201012 const HI : f32 = f32 :: MAX / 2. ;
10211013
10221014 let ( a, b) = ( self , other) ;
1023- let abs_a = a. abs_private ( ) ;
1024- let abs_b = b. abs_private ( ) ;
1015+ let abs_a = a. abs ( ) ;
1016+ let abs_b = b. abs ( ) ;
10251017
10261018 if abs_a <= HI && abs_b <= HI {
10271019 // Overflow is impossible
0 commit comments