diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-02-14 21:17:26 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-02-15 16:59:56 -0800 |
| commit | bb833ca0f0e878d381c3dc0c9afe958a810e4427 (patch) | |
| tree | 7766fd3354b2b0f0418c5ff317df0696b41dbcc1 /src/libsyntax/codemap.rs | |
| parent | 566bcf2225634ee4d4698247fe89364440eb534c (diff) | |
| download | rust-bb833ca0f0e878d381c3dc0c9afe958a810e4427.tar.gz rust-bb833ca0f0e878d381c3dc0c9afe958a810e4427.zip | |
librustc: Stop parsing `impl Type : Trait` and fix several declarations that slipped through. r=tjc
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 3c61e834af6..851b35ca3bd 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -46,71 +46,71 @@ pub enum CharPos = uint; // XXX: Lots of boilerplate in these impls, but so far my attempts to fix // have been unsuccessful -pub impl BytePos: Pos { +pub impl Pos for BytePos { static pure fn from_uint(n: uint) -> BytePos { BytePos(n) } pure fn to_uint(&self) -> uint { **self } } -pub impl BytePos: cmp::Eq { +pub impl cmp::Eq for BytePos { pure fn eq(&self, other: &BytePos) -> bool { **self == **other } pure fn ne(&self, other: &BytePos) -> bool { !(*self).eq(other) } } -pub impl BytePos: cmp::Ord { +pub impl cmp::Ord for BytePos { pure fn lt(&self, other: &BytePos) -> bool { **self < **other } pure fn le(&self, other: &BytePos) -> bool { **self <= **other } pure fn ge(&self, other: &BytePos) -> bool { **self >= **other } pure fn gt(&self, other: &BytePos) -> bool { **self > **other } } -pub impl BytePos: Add<BytePos, BytePos> { +pub impl Add<BytePos, BytePos> for BytePos { pure fn add(&self, rhs: &BytePos) -> BytePos { BytePos(**self + **rhs) } } -pub impl BytePos: Sub<BytePos, BytePos> { +pub impl Sub<BytePos, BytePos> for BytePos { pure fn sub(&self, rhs: &BytePos) -> BytePos { BytePos(**self - **rhs) } } -pub impl BytePos: to_bytes::IterBytes { +pub impl to_bytes::IterBytes for BytePos { pure fn iter_bytes(&self, +lsb0: bool, &&f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f) } } -pub impl CharPos: Pos { +pub impl Pos for CharPos { static pure fn from_uint(n: uint) -> CharPos { CharPos(n) } pure fn to_uint(&self) -> uint { **self } } -pub impl CharPos: cmp::Eq { +pub impl cmp::Eq for CharPos { pure fn eq(&self, other: &CharPos) -> bool { **self == **other } pure fn ne(&self, other: &CharPos) -> bool { !(*self).eq(other) } } -pub impl CharPos: cmp::Ord { +pub impl cmp::Ord for CharPos { pure fn lt(&self, other: &CharPos) -> bool { **self < **other } pure fn le(&self, other: &CharPos) -> bool { **self <= **other } pure fn ge(&self, other: &CharPos) -> bool { **self >= **other } pure fn gt(&self, other: &CharPos) -> bool { **self > **other } } -pub impl CharPos: to_bytes::IterBytes { +pub impl to_bytes::IterBytes for CharPos { pure fn iter_bytes(&self, +lsb0: bool, &&f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f) } } -pub impl CharPos: Add<CharPos, CharPos> { +pub impl Add<CharPos,CharPos> for CharPos { pure fn add(&self, rhs: &CharPos) -> CharPos { CharPos(**self + **rhs) } } -pub impl CharPos: Sub<CharPos, CharPos> { +pub impl Sub<CharPos,CharPos> for CharPos { pure fn sub(&self, rhs: &CharPos) -> CharPos { CharPos(**self - **rhs) } @@ -133,19 +133,19 @@ pub struct span { #[deriving_eq] pub struct spanned<T> { node: T, span: span } -pub impl span : cmp::Eq { +pub impl cmp::Eq for span { pure fn eq(&self, other: &span) -> bool { return (*self).lo == (*other).lo && (*self).hi == (*other).hi; } pure fn ne(&self, other: &span) -> bool { !(*self).eq(other) } } -pub impl<S: Encoder> span: Encodable<S> { +pub impl<S: Encoder> Encodable<S> for span { /* Note #1972 -- spans are encoded but not decoded */ fn encode(&self, _s: &S) { } } -pub impl<D: Decoder> span: Decodable<D> { +pub impl<D: Decoder> Decodable<D> for span { static fn decode(_d: &D) -> span { dummy_sp() } |
