Skip to content

Commit 7c39abd

Browse files
committed
---
yaml --- r: 145085 b: refs/heads/try2 c: 6ba2cb8 h: refs/heads/master i: 145083: da87b6a v: v3
1 parent 246faa2 commit 7c39abd

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 653ffa845d70b26a49e227ae4445729c369c9f80
8+
refs/heads/try2: 6ba2cb88a6866f96f26f2906654f03f97dd8e53b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)