diff options
| author | bors <bors@rust-lang.org> | 2013-05-10 17:56:02 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-10 17:56:02 -0700 |
| commit | 3e0400fb86170baff30282edcdccff73e243fd6e (patch) | |
| tree | ec7cc5de5ce7c80845c77fdcbb670cd54c120783 /src/libsyntax/codemap.rs | |
| parent | d546493096f35e68cbcd9b5d3d7654e7a9345744 (diff) | |
| parent | 606bd75586419948f109de313ab37e31397ca7a3 (diff) | |
| download | rust-3e0400fb86170baff30282edcdccff73e243fd6e.tar.gz rust-3e0400fb86170baff30282edcdccff73e243fd6e.zip | |
auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwalton
Closes #6183. The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout. The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
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 { |
