diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-05-02 18:33:33 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-05-10 02:46:18 -0400 |
| commit | 5eb6d19803ebcb5279f8a42b584a4d81152fa82d (patch) | |
| tree | f64e9e944ccaaf83b8a993c0ce1c404f22c9cd41 /src/libsyntax/codemap.rs | |
| parent | 3ce9dba6775c7e1dbfb510626c073a8f926b6880 (diff) | |
| download | rust-5eb6d19803ebcb5279f8a42b584a4d81152fa82d.tar.gz rust-5eb6d19803ebcb5279f8a42b584a4d81152fa82d.zip | |
syntax: Use the new `for` protocol
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 846097550d1..053ed76d66b 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -65,11 +65,18 @@ impl Sub<BytePos, BytePos> for BytePos { } } +#[cfg(stage0)] impl to_bytes::IterBytes for BytePos { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f) } } +#[cfg(not(stage0))] +impl to_bytes::IterBytes for BytePos { + fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { + (**self).iter_bytes(lsb0, f) + } +} impl Pos for CharPos { fn from_uint(n: uint) -> CharPos { CharPos(n) } @@ -83,11 +90,18 @@ impl cmp::Ord for CharPos { fn gt(&self, other: &CharPos) -> bool { **self > **other } } +#[cfg(stage0)] impl to_bytes::IterBytes for CharPos { fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f) } } +#[cfg(not(stage0))] +impl to_bytes::IterBytes for CharPos { + fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { + (**self).iter_bytes(lsb0, f) + } +} impl Add<CharPos,CharPos> for CharPos { fn add(&self, rhs: &CharPos) -> CharPos { |
