diff --git a/src/libcore/core.rc b/src/libcore/core.rc index 7890d611e853..2a8de6a80322 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -103,7 +103,8 @@ pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter}; pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times}; pub use iter::{ExtendedMutableIter}; -pub use num::{Num, Signed, Unsigned, Natural, NumCast}; +pub use num::{Num, NumCast}; +pub use num::{Signed, Unsigned, Integer}; pub use ptr::Ptr; pub use to_str::ToStr; pub use clone::Clone; diff --git a/src/libcore/num/int-template.rs b/src/libcore/num/int-template.rs index cb29b9e44863..e322e5edeb90 100644 --- a/src/libcore/num/int-template.rs +++ b/src/libcore/num/int-template.rs @@ -279,7 +279,7 @@ impl Signed for T { fn is_negative(&self) -> bool { *self < 0 } } -impl Natural for T { +impl Integer for T { /** * Floored integer division * diff --git a/src/libcore/num/num.rs b/src/libcore/num/num.rs index 8304179c346a..1c3c699603b0 100644 --- a/src/libcore/num/num.rs +++ b/src/libcore/num/num.rs @@ -61,7 +61,7 @@ pub fn abs>(v: T) -> T { if v < Zero::zero() { v.neg() } else { v } } -pub trait Natural: Num +pub trait Integer: Num + Ord + Quot + Rem { diff --git a/src/libcore/num/uint-template.rs b/src/libcore/num/uint-template.rs index 2ee64d4e4eaa..69483f33e528 100644 --- a/src/libcore/num/uint-template.rs +++ b/src/libcore/num/uint-template.rs @@ -176,7 +176,7 @@ impl Neg for T { impl Unsigned for T {} -impl Natural for T { +impl Integer for T { /// Unsigned integer division. Returns the same result as `quot` (`/`). #[inline(always)] fn div(&self, other: T) -> T { *self / other } diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs index 0af0cdf08c91..ec332adb8323 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -37,7 +37,8 @@ pub use hash::Hash; pub use iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter}; pub use iter::{CopyableIter, CopyableOrderedIter, CopyableNonstrictIter}; pub use iter::{Times, ExtendedMutableIter}; -pub use num::{Num, Signed, Unsigned, Natural, NumCast}; +pub use num::{Num, NumCast}; +pub use num::{Signed, Unsigned, Integer}; pub use path::GenericPath; pub use path::Path; pub use path::PosixPath;