about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-05-02 18:33:33 -0400
committerAlex Crichton <alex@alexcrichton.com>2013-05-10 02:46:18 -0400
commit5eb6d19803ebcb5279f8a42b584a4d81152fa82d (patch)
treef64e9e944ccaaf83b8a993c0ce1c404f22c9cd41 /src/libsyntax/parse
parent3ce9dba6775c7e1dbfb510626c073a8f926b6880 (diff)
downloadrust-5eb6d19803ebcb5279f8a42b584a4d81152fa82d.tar.gz
rust-5eb6d19803ebcb5279f8a42b584a4d81152fa82d.zip
syntax: Use the new `for` protocol
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/obsolete.rs8
-rw-r--r--src/libsyntax/parse/token.rs7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index e486a6254e7..a4ac038cf46 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -62,12 +62,20 @@ pub enum ObsoleteSyntax {
     ObsoleteFixedLengthVectorType,
 }
 
+#[cfg(stage0)]
 impl to_bytes::IterBytes for ObsoleteSyntax {
     #[inline(always)]
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
         (*self as uint).iter_bytes(lsb0, f);
     }
 }
+#[cfg(not(stage0))]
+impl to_bytes::IterBytes for ObsoleteSyntax {
+    #[inline(always)]
+    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
+        (*self as uint).iter_bytes(lsb0, f)
+    }
+}
 
 pub impl Parser {
     /// Reports an obsolete syntax non-fatal error.
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index fe7bd5b3bc1..15441b6fcfc 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -355,11 +355,18 @@ impl<'self> Equiv<@~str> for StringRef<'self> {
     fn equiv(&self, other: &@~str) -> bool { str::eq_slice(**self, **other) }
 }
 
+#[cfg(stage0)]
 impl<'self> to_bytes::IterBytes for StringRef<'self> {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
         (**self).iter_bytes(lsb0, f);
     }
 }
+#[cfg(not(stage0))]
+impl<'self> to_bytes::IterBytes for StringRef<'self> {
+    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
+        (**self).iter_bytes(lsb0, f)
+    }
+}
 
 /**
  * Maps a token to a record specifying the corresponding binary