rustc: Add an "ne" method to the Eq trait, and implement it everywhere

This commit is contained in:
Patrick Walton
2012-09-07 12:06:02 -07:00
parent ac1f84c153
commit feb014eb3c
76 changed files with 218 additions and 60 deletions

View File

@@ -36,6 +36,7 @@ impl file_pos: cmp::Eq {
pure fn eq(&&other: file_pos) -> bool {
self.ch == other.ch && self.byte == other.byte
}
pure fn ne(&&other: file_pos) -> bool { !self.eq(other) }
}
/* A codemap is a thing that maps uints to file/line/column positions
@@ -174,6 +175,7 @@ impl span : cmp::Eq {
pure fn eq(&&other: span) -> bool {
return self.lo == other.lo && self.hi == other.hi;
}
pure fn ne(&&other: span) -> bool { !self.eq(other) }
}
fn span_to_str_no_adj(sp: span, cm: codemap) -> ~str {