11use super :: Complex ;
22
33use core:: ops:: Neg ;
4- #[ cfg( feature = "std" ) ]
4+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
55use num_traits:: Float ;
66use num_traits:: { Num , One , Pow } ;
77
@@ -85,7 +85,7 @@ pow_impl!(u128, i128);
8585
8686macro_rules! powf_impl {
8787 ( $F: ty) => {
88- #[ cfg( feature = "std" ) ]
88+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
8989 impl <' a, T : Float > Pow <$F> for & ' a Complex <T >
9090 where
9191 $F: Into <T >,
@@ -98,7 +98,7 @@ macro_rules! powf_impl {
9898 }
9999 }
100100
101- #[ cfg( feature = "std" ) ]
101+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
102102 impl <' a, ' b, T : Float > Pow <& ' b $F> for & ' a Complex <T >
103103 where
104104 $F: Into <T >,
@@ -111,7 +111,7 @@ macro_rules! powf_impl {
111111 }
112112 }
113113
114- #[ cfg( feature = "std" ) ]
114+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
115115 impl <T : Float > Pow <$F> for Complex <T >
116116 where
117117 $F: Into <T >,
@@ -124,7 +124,7 @@ macro_rules! powf_impl {
124124 }
125125 }
126126
127- #[ cfg( feature = "std" ) ]
127+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
128128 impl <' b, T : Float > Pow <& ' b $F> for Complex <T >
129129 where
130130 $F: Into <T >,
@@ -145,7 +145,7 @@ powf_impl!(f64);
145145// These blanket impls are OK, because both the target type and the trait parameter would be
146146// foreign to anyone else trying to implement something that would overlap, raising E0117.
147147
148- #[ cfg( feature = "std" ) ]
148+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
149149impl < ' a , T : Float > Pow < Complex < T > > for & ' a Complex < T > {
150150 type Output = Complex < T > ;
151151
@@ -155,7 +155,7 @@ impl<'a, T: Float> Pow<Complex<T>> for &'a Complex<T> {
155155 }
156156}
157157
158- #[ cfg( feature = "std" ) ]
158+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
159159impl < ' a , ' b , T : Float > Pow < & ' b Complex < T > > for & ' a Complex < T > {
160160 type Output = Complex < T > ;
161161
@@ -165,7 +165,7 @@ impl<'a, 'b, T: Float> Pow<&'b Complex<T>> for &'a Complex<T> {
165165 }
166166}
167167
168- #[ cfg( feature = "std" ) ]
168+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
169169impl < T : Float > Pow < Complex < T > > for Complex < T > {
170170 type Output = Complex < T > ;
171171
@@ -175,7 +175,7 @@ impl<T: Float> Pow<Complex<T>> for Complex<T> {
175175 }
176176}
177177
178- #[ cfg( feature = "std" ) ]
178+ #[ cfg( any ( feature = "std" , feature = "libm" ) ) ]
179179impl < ' b , T : Float > Pow < & ' b Complex < T > > for Complex < T > {
180180 type Output = Complex < T > ;
181181
0 commit comments