summary refs log tree commit diff
path: root/src/libstd/workcache.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-10 17:56:02 -0700
committerbors <bors@rust-lang.org>2013-05-10 17:56:02 -0700
commit3e0400fb86170baff30282edcdccff73e243fd6e (patch)
treeec7cc5de5ce7c80845c77fdcbb670cd54c120783 /src/libstd/workcache.rs
parentd546493096f35e68cbcd9b5d3d7654e7a9345744 (diff)
parent606bd75586419948f109de313ab37e31397ca7a3 (diff)
downloadrust-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/libstd/workcache.rs')
-rw-r--r--src/libstd/workcache.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs
index dc9204f62f4..9b0a6cb6226 100644
--- a/src/libstd/workcache.rs
+++ b/src/libstd/workcache.rs
@@ -99,6 +99,7 @@ struct WorkKey {
     name: ~str
 }
 
+#[cfg(stage0)]
 impl to_bytes::IterBytes for WorkKey {
     #[inline(always)]
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
@@ -108,6 +109,13 @@ impl to_bytes::IterBytes for WorkKey {
         self.name.iter_bytes(lsb0, f);
     }
 }
+#[cfg(not(stage0))]
+impl to_bytes::IterBytes for WorkKey {
+    #[inline(always)]
+    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
+        self.kind.iter_bytes(lsb0, f) && self.name.iter_bytes(lsb0, f)
+    }
+}
 
 impl cmp::Ord for WorkKey {
     fn lt(&self, other: &WorkKey) -> bool {