about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@pobox.com>2012-11-30 12:20:59 -0800
committerGraydon Hoare <graydon@pobox.com>2012-11-30 12:20:59 -0800
commitf89d4ac8306dbe597f0bfef7cf92bea372eece1d (patch)
tree2f40e7042228c2ce0874f972c92d82a89cf15985 /src/libsyntax
parent946427b562d7ece5fc85c5067051c4aec73d5aff (diff)
parentd783f4d7bb543f33aaf0fc8a04c6d5b2493e8268 (diff)
downloadrust-f89d4ac8306dbe597f0bfef7cf92bea372eece1d.tar.gz
rust-f89d4ac8306dbe597f0bfef7cf92bea372eece1d.zip
Merge pull request #4081 from graydon/iterbytes-and-workcache
libs: Remove transitionary material on iter_bytes, add workcache to buil...
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs127
-rw-r--r--src/libsyntax/ast_util.rs9
-rw-r--r--src/libsyntax/codemap.rs17
-rw-r--r--src/libsyntax/parse/obsolete.rs9
4 files changed, 0 insertions, 162 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 252ccdc3e1b..1ffe741d255 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -54,15 +54,6 @@ impl ident: cmp::Eq {
     pure fn ne(&self, other: &ident) -> bool { !(*self).eq(other) }
 }
 
-#[cfg(stage0)]
-impl ident: to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        self.repr.iter_bytes(lsb0, f)
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl ident: to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         self.repr.iter_bytes(lsb0, f)
@@ -311,25 +302,6 @@ enum binding_mode {
     bind_by_implicit_ref
 }
 
-#[cfg(stage0)]
-impl binding_mode : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        match self {
-          bind_by_value => 0u8.iter_bytes(lsb0, f),
-
-          bind_by_move => 1u8.iter_bytes(lsb0, f),
-
-          bind_by_ref(ref m) =>
-          to_bytes::iter_bytes_2(&2u8, m, lsb0, f),
-
-          bind_by_implicit_ref =>
-          3u8.iter_bytes(lsb0, f),
-        }
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl binding_mode : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         match *self {
@@ -406,15 +378,6 @@ enum pat_ {
 #[auto_deserialize]
 enum mutability { m_mutbl, m_imm, m_const, }
 
-#[cfg(stage0)]
-impl mutability : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl mutability : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -444,15 +407,6 @@ impl Proto : cmp::Eq {
     pure fn ne(&self, other: &Proto) -> bool { !(*self).eq(other) }
 }
 
-#[cfg(stage0)]
-impl Proto : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as uint).iter_bytes(lsb0, f);
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl Proto : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as uint).iter_bytes(lsb0, f);
@@ -576,21 +530,6 @@ enum inferable<T> {
     infer(node_id)
 }
 
-#[cfg(stage0)]
-impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        match self {
-          expl(ref t) =>
-          to_bytes::iter_bytes_2(&0u8, t, lsb0, f),
-
-          infer(ref n) =>
-          to_bytes::iter_bytes_2(&1u8, n, lsb0, f),
-        }
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         match *self {
@@ -628,14 +567,6 @@ impl<T:cmp::Eq> inferable<T> : cmp::Eq {
 #[auto_deserialize]
 enum rmode { by_ref, by_val, by_move, by_copy }
 
-#[cfg(stage0)]
-impl rmode : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl rmode : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -985,14 +916,6 @@ enum trait_method {
 #[auto_deserialize]
 enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
 
-#[cfg(stage0)]
-impl int_ty : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl int_ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1023,14 +946,6 @@ impl int_ty : cmp::Eq {
 #[auto_deserialize]
 enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
 
-#[cfg(stage0)]
-impl uint_ty : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl uint_ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1059,14 +974,6 @@ impl uint_ty : cmp::Eq {
 #[auto_deserialize]
 enum float_ty { ty_f, ty_f32, ty_f64, }
 
-#[cfg(stage0)]
-impl float_ty : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl float_ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1212,15 +1119,6 @@ impl Ty : cmp::Eq {
     }
 }
 
-#[cfg(stage0)]
-impl Ty : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl Ty : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
@@ -1248,15 +1146,6 @@ enum purity {
     extern_fn, // declared with "extern fn"
 }
 
-#[cfg(stage0)]
-impl purity : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl purity : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1278,14 +1167,6 @@ enum ret_style {
     return_val, // everything else
 }
 
-#[cfg(stage0)]
-impl ret_style : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl ret_style : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
@@ -1635,14 +1516,6 @@ enum item_ {
 #[auto_deserialize]
 enum class_mutability { class_mutable, class_immutable }
 
-#[cfg(stage0)]
-impl class_mutability : to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl class_mutability : to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (*self as u8).iter_bytes(lsb0, f)
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index d0cd6ad54d1..0b066b57168 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -252,15 +252,6 @@ pure fn is_call_expr(e: @expr) -> bool {
 }
 
 // This makes def_id hashable
-#[cfg(stage0)]
-impl def_id : core::to_bytes::IterBytes {
-    #[inline(always)]
-    pure fn iter_bytes(+lsb0: bool, f: core::to_bytes::Cb) {
-        core::to_bytes::iter_bytes_2(&self.crate, &self.node, lsb0, f);
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl def_id : core::to_bytes::IterBytes {
     #[inline(always)]
     pure fn iter_bytes(&self, +lsb0: bool, f: core::to_bytes::Cb) {
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 8126f1d7200..693597eb840 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -72,15 +72,6 @@ impl BytePos: Num {
     static pure fn from_int(+n: int) -> BytePos { BytePos(n as uint) }
 }
 
-#[cfg(stage0)]
-impl BytePos: to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (*self).iter_bytes(lsb0, f)
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl BytePos: to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (**self).iter_bytes(lsb0, f)
@@ -127,14 +118,6 @@ impl CharPos: Num {
     static pure fn from_int(+n: int) -> CharPos { CharPos(n as uint) }
 }
 
-#[cfg(stage0)]
-impl CharPos: to_bytes::IterBytes {
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (*self).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl CharPos: to_bytes::IterBytes {
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
         (**self).iter_bytes(lsb0, f)
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 1407b56336c..afa87c261f1 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -36,15 +36,6 @@ impl ObsoleteSyntax : cmp::Eq {
     }
 }
 
-#[cfg(stage0)]
-impl ObsoleteSyntax: to_bytes::IterBytes {
-    #[inline(always)]
-    pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
-        (self as uint).iter_bytes(lsb0, f);
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl ObsoleteSyntax: to_bytes::IterBytes {
     #[inline(always)]
     pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {