Ver código fonte

Revert #[inline] hints

Yoan Lecoq 8 anos atrás
pai
commit
f4e0b47ceb
4 arquivos alterados com 4 adições e 12 exclusões
  1. 4 5
      traits/src/cast.rs
  2. 0 3
      traits/src/identities.rs
  3. 0 1
      traits/src/lib.rs
  4. 0 3
      traits/src/ops/wrapping.rs

+ 4 - 5
traits/src/cast.rs

@@ -388,12 +388,12 @@ impl_from_primitive!(f64,   to_f64);
 
 
 impl<T: ToPrimitive> ToPrimitive for Wrapping<T> {
-    #[inline] fn to_i64(&self) -> Option<i64> { self.0.to_i64() }
-    #[inline] fn to_u64(&self) -> Option<u64> { self.0.to_u64() }
+    fn to_i64(&self) -> Option<i64> { self.0.to_i64() }
+    fn to_u64(&self) -> Option<u64> { self.0.to_u64() }
 }
 impl<T: FromPrimitive> FromPrimitive for Wrapping<T> {
-    #[inline] fn from_u64(n: u64) -> Option<Self> { T::from_u64(n).map(Wrapping) }
-    #[inline] fn from_i64(n: i64) -> Option<Self> { T::from_i64(n).map(Wrapping) }
+    fn from_u64(n: u64) -> Option<Self> { T::from_u64(n).map(Wrapping) }
+    fn from_i64(n: i64) -> Option<Self> { T::from_i64(n).map(Wrapping) }
 }
 
 
@@ -447,7 +447,6 @@ impl_num_cast!(f32,   to_f32);
 impl_num_cast!(f64,   to_f64);
 
 impl<T: NumCast> NumCast for Wrapping<T> {
-    #[inline]
     fn from<U: ToPrimitive>(n: U) -> Option<Self> {
         T::from(n).map(Wrapping)
     }

+ 0 - 3
traits/src/identities.rs

@@ -52,11 +52,9 @@ zero_impl!(f32, 0.0f32);
 zero_impl!(f64, 0.0f64);
 
 impl<T: Zero> Zero for Wrapping<T> where Wrapping<T>: Add<Output=Wrapping<T>> {
-    #[inline]
     fn is_zero(&self) -> bool {
         self.0.is_zero()
     }
-    #[inline]
     fn zero() -> Self {
         Wrapping(T::zero())
     }
@@ -108,7 +106,6 @@ one_impl!(f32, 1.0f32);
 one_impl!(f64, 1.0f64);
 
 impl<T: One> One for Wrapping<T> where Wrapping<T>: Mul<Output=Wrapping<T>> {
-    #[inline]
     fn one() -> Self {
         Wrapping(T::one())
     }

+ 0 - 1
traits/src/lib.rs

@@ -81,7 +81,6 @@ impl<T: Num> Num for Wrapping<T>
         + Mul<Output = Wrapping<T>> + Div<Output = Wrapping<T>> + Rem<Output = Wrapping<T>>
 {
     type FromStrRadixErr = T::FromStrRadixErr;
-    #[inline]
     fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr> {
         T::from_str_radix(str, radix).map(Wrapping)
     }

+ 0 - 3
traits/src/ops/wrapping.rs

@@ -79,19 +79,16 @@ wrapping_impl!(WrappingMul, wrapping_mul, isize);
 
 // Well this is a bit funny, but all the more appropriate.
 impl<T: WrappingAdd> WrappingAdd for Wrapping<T> where Wrapping<T>: Add<Output = Wrapping<T>> {
-    #[inline]
     fn wrapping_add(&self, v: &Self) -> Self {
         Wrapping(self.0.wrapping_add(&v.0))
     }
 }
 impl<T: WrappingSub> WrappingSub for Wrapping<T> where Wrapping<T>: Sub<Output = Wrapping<T>> {
-    #[inline]
     fn wrapping_sub(&self, v: &Self) -> Self {
         Wrapping(self.0.wrapping_sub(&v.0))
     }
 }
 impl<T: WrappingMul> WrappingMul for Wrapping<T> where Wrapping<T>: Mul<Output = Wrapping<T>> {
-    #[inline]
     fn wrapping_mul(&self, v: &Self) -> Self {
         Wrapping(self.0.wrapping_mul(&v.0))
     }