about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libsyntax/codemap.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 1c3a8e81e55..c8e40b82e0c 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -30,12 +30,12 @@ pub trait Pos {
 }
 
 /// A byte offset
-#[deriving(Clone, Eq, IterBytes)]
+#[deriving(Clone, Eq, IterBytes, Ord)]
 pub struct BytePos(uint);
 /// A character offset. Because of multibyte utf8 characters, a byte offset
 /// is not equivalent to a character offset. The CodeMap will convert BytePos
 /// values to CharPos values as necessary.
-#[deriving(Eq,IterBytes)]
+#[deriving(Eq,IterBytes, Ord)]
 pub struct CharPos(uint);
 
 // XXX: Lots of boilerplate in these impls, but so far my attempts to fix
@@ -46,13 +46,6 @@ impl Pos for BytePos {
     fn to_uint(&self) -> uint { **self }
 }
 
-impl cmp::Ord for BytePos {
-    fn lt(&self, other: &BytePos) -> bool { **self < **other }
-    fn le(&self, other: &BytePos) -> bool { **self <= **other }
-    fn ge(&self, other: &BytePos) -> bool { **self >= **other }
-    fn gt(&self, other: &BytePos) -> bool { **self > **other }
-}
-
 impl Add<BytePos, BytePos> for BytePos {
     fn add(&self, rhs: &BytePos) -> BytePos {
         BytePos(**self + **rhs)
@@ -70,13 +63,6 @@ impl Pos for CharPos {
     fn to_uint(&self) -> uint { **self }
 }
 
-impl cmp::Ord for CharPos {
-    fn lt(&self, other: &CharPos) -> bool { **self < **other }
-    fn le(&self, other: &CharPos) -> bool { **self <= **other }
-    fn ge(&self, other: &CharPos) -> bool { **self >= **other }
-    fn gt(&self, other: &CharPos) -> bool { **self > **other }
-}
-
 impl Add<CharPos,CharPos> for CharPos {
     fn add(&self, rhs: &CharPos) -> CharPos {
         CharPos(**self + **rhs)