about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2014-11-08 22:34:19 -0500
committerJosh Haberman <jhaberman@gmail.com>2014-11-08 22:34:19 -0500
commita7533b8a6b7d2aa01e0ea8859c6dc7a61c6e90c3 (patch)
treeef55e292148620607d855647be355847078d0ad5
parent34af03681f2be9aa3ad0fdb567c27ff9f096db39 (diff)
downloadrust-a7533b8a6b7d2aa01e0ea8859c6dc7a61c6e90c3.tar.gz
rust-a7533b8a6b7d2aa01e0ea8859c6dc7a61c6e90c3.zip
Make Int inherit from Ord.
Previously Int inherited from PartialOrd (via Primitive)
but not Ord.  But integers have a total order, so
inheriting from Ord is appropriate. Fixes #18776.
-rw-r--r--src/libcore/num/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index a177b89058c..d14bcb36944 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -19,7 +19,7 @@ use {int, i8, i16, i32, i64};
 use {uint, u8, u16, u32, u64};
 use {f32, f64};
 use clone::Clone;
-use cmp::{PartialEq, PartialOrd};
+use cmp::{Ord, PartialEq, PartialOrd};
 use kinds::Copy;
 use mem::size_of;
 use ops::{Add, Sub, Mul, Div, Rem, Neg};
@@ -386,6 +386,7 @@ trait_impl!(Primitive for uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64)
 /// A primitive signed or unsigned integer equipped with various bitwise
 /// operators, bit counting methods, and endian conversion functions.
 pub trait Int: Primitive
+             + Ord
              + CheckedAdd
              + CheckedSub
              + CheckedMul