Skip to content

Commit fb3d9d0

Browse files
committed
---
yaml --- r: 80791 b: refs/heads/try c: 6ba2cb8 h: refs/heads/master i: 80789: abc917c 80787: 3129654 80783: 2b5e242 v: v3
1 parent 8fe144e commit fb3d9d0

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: 653ffa845d70b26a49e227ae4445729c369c9f80
5+
refs/heads/try: 6ba2cb88a6866f96f26f2906654f03f97dd8e53b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/codemap.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ pub trait Pos {
3030
}
3131

3232
/// A byte offset
33-
#[deriving(Clone, Eq, IterBytes)]
33+
#[deriving(Clone, Eq, IterBytes, Ord)]
3434
pub struct BytePos(uint);
3535
/// A character offset. Because of multibyte utf8 characters, a byte offset
3636
/// is not equivalent to a character offset. The CodeMap will convert BytePos
3737
/// values to CharPos values as necessary.
38-
#[deriving(Eq,IterBytes)]
38+
#[deriving(Eq,IterBytes, Ord)]
3939
pub struct CharPos(uint);
4040

4141
// XXX: Lots of boilerplate in these impls, but so far my attempts to fix
@@ -46,13 +46,6 @@ impl Pos for BytePos {
4646
fn to_uint(&self) -> uint { **self }
4747
}
4848

49-
impl cmp::Ord for BytePos {
50-
fn lt(&self, other: &BytePos) -> bool { **self < **other }
51-
fn le(&self, other: &BytePos) -> bool { **self <= **other }
52-
fn ge(&self, other: &BytePos) -> bool { **self >= **other }
53-
fn gt(&self, other: &BytePos) -> bool { **self > **other }
54-
}
55-
5649
impl Add<BytePos, BytePos> for BytePos {
5750
fn add(&self, rhs: &BytePos) -> BytePos {
5851
BytePos(**self + **rhs)
@@ -70,13 +63,6 @@ impl Pos for CharPos {
7063
fn to_uint(&self) -> uint { **self }
7164
}
7265

73-
impl cmp::Ord for CharPos {
74-
fn lt(&self, other: &CharPos) -> bool { **self < **other }
75-
fn le(&self, other: &CharPos) -> bool { **self <= **other }
76-
fn ge(&self, other: &CharPos) -> bool { **self >= **other }
77-
fn gt(&self, other: &CharPos) -> bool { **self > **other }
78-
}
79-
8066
impl Add<CharPos,CharPos> for CharPos {
8167
fn add(&self, rhs: &CharPos) -> CharPos {
8268
CharPos(**self + **rhs)

0 commit comments

Comments
 (0)