@@ -27,7 +27,7 @@ pub use num_traits::float::FloatCore;
2727use num_traits:: {
2828 AsPrimitive , Bounded , FloatConst , FromPrimitive , Num , NumCast , One , Signed , ToPrimitive , Zero ,
2929} ;
30- #[ cfg( feature = "std" ) ]
30+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
3131pub use num_traits:: { Float , Pow } ;
3232
3333#[ cfg( feature = "rand" ) ]
@@ -571,7 +571,7 @@ impl_ordered_float_binop! {Rem, rem, RemAssign, rem_assign}
571571
572572macro_rules! impl_ordered_float_pow {
573573 ( $inner: ty, $rhs: ty) => {
574- #[ cfg( feature = "std" ) ]
574+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
575575 impl Pow <$rhs> for OrderedFloat <$inner> {
576576 type Output = OrderedFloat <$inner>;
577577 #[ inline]
@@ -580,7 +580,7 @@ macro_rules! impl_ordered_float_pow {
580580 }
581581 }
582582
583- #[ cfg( feature = "std" ) ]
583+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
584584 impl <' a> Pow <& ' a $rhs> for OrderedFloat <$inner> {
585585 type Output = OrderedFloat <$inner>;
586586 #[ inline]
@@ -589,7 +589,7 @@ macro_rules! impl_ordered_float_pow {
589589 }
590590 }
591591
592- #[ cfg( feature = "std" ) ]
592+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
593593 impl <' a> Pow <$rhs> for & ' a OrderedFloat <$inner> {
594594 type Output = OrderedFloat <$inner>;
595595 #[ inline]
@@ -598,7 +598,7 @@ macro_rules! impl_ordered_float_pow {
598598 }
599599 }
600600
601- #[ cfg( feature = "std" ) ]
601+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
602602 impl <' a, ' b> Pow <& ' a $rhs> for & ' b OrderedFloat <$inner> {
603603 type Output = OrderedFloat <$inner>;
604604 #[ inline]
@@ -625,7 +625,7 @@ impl_ordered_float_pow! {f64, f64}
625625
626626macro_rules! impl_ordered_float_self_pow {
627627 ( $base: ty, $exp: ty) => {
628- #[ cfg( feature = "std" ) ]
628+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
629629 impl Pow <OrderedFloat <$exp>> for OrderedFloat <$base> {
630630 type Output = OrderedFloat <$base>;
631631 #[ inline]
@@ -634,7 +634,7 @@ macro_rules! impl_ordered_float_self_pow {
634634 }
635635 }
636636
637- #[ cfg( feature = "std" ) ]
637+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
638638 impl <' a> Pow <& ' a OrderedFloat <$exp>> for OrderedFloat <$base> {
639639 type Output = OrderedFloat <$base>;
640640 #[ inline]
@@ -643,7 +643,7 @@ macro_rules! impl_ordered_float_self_pow {
643643 }
644644 }
645645
646- #[ cfg( feature = "std" ) ]
646+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
647647 impl <' a> Pow <OrderedFloat <$exp>> for & ' a OrderedFloat <$base> {
648648 type Output = OrderedFloat <$base>;
649649 #[ inline]
@@ -652,7 +652,7 @@ macro_rules! impl_ordered_float_self_pow {
652652 }
653653 }
654654
655- #[ cfg( feature = "std" ) ]
655+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
656656 impl <' a, ' b> Pow <& ' a OrderedFloat <$exp>> for & ' b OrderedFloat <$base> {
657657 type Output = OrderedFloat <$base>;
658658 #[ inline]
@@ -1037,7 +1037,7 @@ impl<T: FloatCore> FloatCore for OrderedFloat<T> {
10371037 }
10381038}
10391039
1040- #[ cfg( feature = "std" ) ]
1040+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
10411041impl < T : Float + FloatCore > Float for OrderedFloat < T > {
10421042 fn nan ( ) -> Self {
10431043 OrderedFloat ( <T as Float >:: nan ( ) )
@@ -1663,7 +1663,7 @@ impl_not_nan_binop! {Rem, rem, RemAssign, rem_assign}
16631663// Will panic if NaN value is return from the operation
16641664macro_rules! impl_not_nan_pow {
16651665 ( $inner: ty, $rhs: ty) => {
1666- #[ cfg( feature = "std" ) ]
1666+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
16671667 impl Pow <$rhs> for NotNan <$inner> {
16681668 type Output = NotNan <$inner>;
16691669 #[ inline]
@@ -1672,7 +1672,7 @@ macro_rules! impl_not_nan_pow {
16721672 }
16731673 }
16741674
1675- #[ cfg( feature = "std" ) ]
1675+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
16761676 impl <' a> Pow <& ' a $rhs> for NotNan <$inner> {
16771677 type Output = NotNan <$inner>;
16781678 #[ inline]
@@ -1681,7 +1681,7 @@ macro_rules! impl_not_nan_pow {
16811681 }
16821682 }
16831683
1684- #[ cfg( feature = "std" ) ]
1684+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
16851685 impl <' a> Pow <$rhs> for & ' a NotNan <$inner> {
16861686 type Output = NotNan <$inner>;
16871687 #[ inline]
@@ -1690,7 +1690,7 @@ macro_rules! impl_not_nan_pow {
16901690 }
16911691 }
16921692
1693- #[ cfg( feature = "std" ) ]
1693+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
16941694 impl <' a, ' b> Pow <& ' a $rhs> for & ' b NotNan <$inner> {
16951695 type Output = NotNan <$inner>;
16961696 #[ inline]
@@ -1718,7 +1718,7 @@ impl_not_nan_pow! {f64, f64}
17181718// This also should panic on NaN
17191719macro_rules! impl_not_nan_self_pow {
17201720 ( $base: ty, $exp: ty) => {
1721- #[ cfg( feature = "std" ) ]
1721+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
17221722 impl Pow <NotNan <$exp>> for NotNan <$base> {
17231723 type Output = NotNan <$base>;
17241724 #[ inline]
@@ -1727,7 +1727,7 @@ macro_rules! impl_not_nan_self_pow {
17271727 }
17281728 }
17291729
1730- #[ cfg( feature = "std" ) ]
1730+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
17311731 impl <' a> Pow <& ' a NotNan <$exp>> for NotNan <$base> {
17321732 type Output = NotNan <$base>;
17331733 #[ inline]
@@ -1736,7 +1736,7 @@ macro_rules! impl_not_nan_self_pow {
17361736 }
17371737 }
17381738
1739- #[ cfg( feature = "std" ) ]
1739+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
17401740 impl <' a> Pow <NotNan <$exp>> for & ' a NotNan <$base> {
17411741 type Output = NotNan <$base>;
17421742 #[ inline]
@@ -1745,7 +1745,7 @@ macro_rules! impl_not_nan_self_pow {
17451745 }
17461746 }
17471747
1748- #[ cfg( feature = "std" ) ]
1748+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
17491749 impl <' a, ' b> Pow <& ' a NotNan <$exp>> for & ' b NotNan <$base> {
17501750 type Output = NotNan <$base>;
17511751 #[ inline]
0 commit comments