diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-01-18 17:08:23 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-01-20 18:09:46 +1100 |
| commit | cf56624a4ad7703c8f3fc327b8c385da0a803ea5 (patch) | |
| tree | 0a46f95db2c26f4beb50f7785a82f46348ff9083 /src/libstd/tuple.rs | |
| parent | 764f2cb6f3517869e31fc7b93ff11dd840db8d30 (diff) | |
| download | rust-cf56624a4ad7703c8f3fc327b8c385da0a803ea5.tar.gz rust-cf56624a4ad7703c8f3fc327b8c385da0a803ea5.zip | |
Add operator trait constraints to std::num::{Zero, One} and document their appropriate use
Zero and One have precise definitions in mathematics. Documentation has been added to describe the appropriate uses for these traits and the laws that they should satisfy. For more information regarding these identities, see the following wikipedia pages: - http://wikipedia.org/wiki/Additive_identity - http://wikipedia.org/wiki/Multiplicative_identity
Diffstat (limited to 'src/libstd/tuple.rs')
| -rw-r--r-- | src/libstd/tuple.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/libstd/tuple.rs b/src/libstd/tuple.rs index 313fd9c79b4..8e278aeb2ea 100644 --- a/src/libstd/tuple.rs +++ b/src/libstd/tuple.rs @@ -15,7 +15,6 @@ use clone::Clone; #[cfg(not(test))] use cmp::*; #[cfg(not(test))] use default::Default; -#[cfg(not(test))] use num::Zero; /// Method extensions to pairs where both types satisfy the `Clone` bound pub trait CopyableTuple<T, U> { @@ -177,18 +176,6 @@ macro_rules! tuple_impls { ($({ let x: $T = Default::default(); x},)+) } } - - #[cfg(not(test))] - impl<$($T:Zero),+> Zero for ($($T,)+) { - #[inline] - fn zero() -> ($($T,)+) { - ($({ let x: $T = Zero::zero(); x},)+) - } - #[inline] - fn is_zero(&self) -> bool { - $(self.$get_ref_fn().is_zero())&&+ - } - } )+ } } |
