about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-20 02:46:36 -0700
committerbors <bors@rust-lang.org>2013-05-20 02:46:36 -0700
commit2e6cda254a2acdcd60efb62a27f69c7702b8f71e (patch)
treeba2b843a8a0cd261cf94b4e6ab017d0918841f3c /src/libsyntax
parentab46a38039c320bd2011160fdd8a86828172d29e (diff)
parent66319b027888ceddf024a5919e007caceaf369f3 (diff)
downloadrust-2e6cda254a2acdcd60efb62a27f69c7702b8f71e.tar.gz
rust-2e6cda254a2acdcd60efb62a27f69c7702b8f71e.zip
auto merge of #6635 : brson/rust/snapshot, r=brson
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/abi.rs39
-rw-r--r--src/libsyntax/ast.rs108
-rw-r--r--src/libsyntax/ast_util.rs9
-rw-r--r--src/libsyntax/codemap.rs48
-rw-r--r--src/libsyntax/ext/pipes/proto.rs15
-rw-r--r--src/libsyntax/opt_vec.rs14
-rw-r--r--src/libsyntax/parse/obsolete.rs8
-rw-r--r--src/libsyntax/parse/token.rs8
8 files changed, 0 insertions, 249 deletions
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs
index 1b166dcf366..e67b5d118d3 100644
--- a/src/libsyntax/abi.rs
+++ b/src/libsyntax/abi.rs
@@ -79,20 +79,6 @@ static AbiDatas: &'static [AbiData] = &[
     AbiData {abi: RustIntrinsic, name: "rust-intrinsic", abi_arch: RustArch},
 ];
 
-#[cfg(stage0)]
-fn each_abi(op: &fn(abi: Abi) -> bool) {
-    /*!
-     *
-     * Iterates through each of the defined ABIs.
-     */
-
-    for AbiDatas.each |abi_data| {
-        if !op(abi_data.abi) {
-            return;
-        }
-    }
-}
-#[cfg(not(stage0))]
 fn each_abi(op: &fn(abi: Abi) -> bool) -> bool {
     /*!
      *
@@ -197,17 +183,6 @@ pub impl AbiSet {
         self.bits |= (1 << abi.index());
     }
 
-    #[cfg(stage0)]
-    fn each(&self, op: &fn(abi: Abi) -> bool) {
-        for each_abi |abi| {
-            if self.contains(abi) {
-                if !op(abi) {
-                    return;
-                }
-            }
-        }
-    }
-    #[cfg(not(stage0))]
     fn each(&self, op: &fn(abi: Abi) -> bool) -> bool {
         each_abi(|abi| !self.contains(abi) || op(abi))
     }
@@ -265,26 +240,12 @@ pub impl AbiSet {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for Abi {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        self.index().iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for Abi {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         self.index().iter_bytes(lsb0, f)
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for AbiSet {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        self.bits.iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for AbiSet {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         self.bits.iter_bytes(lsb0, f)
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index dcbbd7ab531..241450e7130 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -95,14 +95,6 @@ impl<D:Decoder> Decodable<D> for ident {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for ident {
-    #[inline(always)]
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        self.repr.iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for ident {
     #[inline(always)]
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
@@ -120,14 +112,6 @@ pub struct Lifetime {
     ident: ident
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for Lifetime {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_3(&self.id, &self.span, &self.ident, lsb0, f)
-    }
-}
-
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for Lifetime {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         to_bytes::iter_bytes_3(&self.id, &self.span, &self.ident, lsb0, f)
@@ -279,21 +263,6 @@ pub enum binding_mode {
     bind_infer
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for binding_mode {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        match *self {
-          bind_by_copy => 0u8.iter_bytes(lsb0, f),
-
-          bind_by_ref(ref m) =>
-          to_bytes::iter_bytes_2(&1u8, m, lsb0, f),
-
-          bind_infer =>
-          2u8.iter_bytes(lsb0, f),
-        }
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for binding_mode {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         match *self {
@@ -334,13 +303,6 @@ pub enum pat_ {
 #[deriving(Eq, Encodable, Decodable)]
 pub enum mutability { m_mutbl, m_imm, m_const, }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for mutability {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        (*self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for mutability {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as u8).iter_bytes(lsb0, f)
@@ -354,13 +316,6 @@ pub enum Sigil {
     ManagedSigil
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for Sigil {
-    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 Sigil {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as uint).iter_bytes(lsb0, f)
@@ -718,13 +673,6 @@ impl ToStr for int_ty {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for int_ty {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        (*self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for int_ty {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as u8).iter_bytes(lsb0, f)
@@ -740,13 +688,6 @@ impl ToStr for uint_ty {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for uint_ty {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        (*self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for uint_ty {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as u8).iter_bytes(lsb0, f)
@@ -762,13 +703,6 @@ impl ToStr for float_ty {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for float_ty {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        (*self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for float_ty {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as u8).iter_bytes(lsb0, f)
@@ -808,13 +742,6 @@ impl ToStr for Onceness {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for Onceness {
-    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 Onceness {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as uint).iter_bytes(lsb0, f)
@@ -861,13 +788,6 @@ pub enum ty_ {
     ty_infer,
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for Ty {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for Ty {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f)
@@ -925,13 +845,6 @@ impl ToStr for purity {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for purity {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        (*self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for purity {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as u8).iter_bytes(lsb0, f)
@@ -945,13 +858,6 @@ pub enum ret_style {
     return_val, // everything else
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for ret_style {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        (*self as u8).iter_bytes(lsb0, f)
-    }
-}
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for ret_style {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         (*self as u8).iter_bytes(lsb0, f)
@@ -967,20 +873,6 @@ pub enum explicit_self_ {
     sty_uniq(mutability)                       // `~self`
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for explicit_self_ {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        match *self {
-            sty_static => 0u8.iter_bytes(lsb0, f),
-            sty_value => 1u8.iter_bytes(lsb0, f),
-            sty_region(ref lft, ref mutbl) => to_bytes::iter_bytes_3(&2u8, &lft, mutbl, lsb0, f),
-            sty_box(ref mutbl) => to_bytes::iter_bytes_2(&3u8, mutbl, lsb0, f),
-            sty_uniq(ref mutbl) => to_bytes::iter_bytes_2(&4u8, mutbl, lsb0, f),
-        }
-    }
-}
-
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for explicit_self_ {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         match *self {
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index d4a67d61d94..bb6d13b2831 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -191,15 +191,6 @@ pub fn is_call_expr(e: @expr) -> bool {
 }
 
 // This makes def_id hashable
-#[cfg(stage0)]
-impl to_bytes::IterBytes for def_id {
-    #[inline(always)]
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_2(&self.crate, &self.node, lsb0, f);
-    }
-}
-// This makes def_id hashable
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for def_id {
     #[inline(always)]
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 61921fbf090..2e235982a0f 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -65,13 +65,6 @@ 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)
@@ -90,13 +83,6 @@ 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)
@@ -150,14 +136,6 @@ impl<D:Decoder> Decodable<D> for span {
     }
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for span {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_3(&self.lo, &self.hi, &self.expn_info, lsb0, f);
-    }
-}
-
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for span {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         to_bytes::iter_bytes_3(&self.lo, &self.hi, &self.expn_info, lsb0, f)
@@ -211,14 +189,6 @@ pub struct FileMapAndLine {fm: @FileMap, line: uint}
 pub struct FileMapAndBytePos {fm: @FileMap, pos: BytePos}
 pub struct NameAndSpan {name: ~str, span: Option<span>}
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for NameAndSpan {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_2(&self.name, &self.span, lsb0, f)
-    }
-}
-
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for NameAndSpan {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         to_bytes::iter_bytes_2(&self.name, &self.span, lsb0, f)
@@ -230,14 +200,6 @@ pub struct CallInfo {
     callee: NameAndSpan
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for CallInfo {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        to_bytes::iter_bytes_2(&self.call_site, &self.callee, lsb0, f)
-    }
-}
-
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for CallInfo {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         to_bytes::iter_bytes_2(&self.call_site, &self.callee, lsb0, f)
@@ -249,16 +211,6 @@ pub enum ExpnInfo {
     ExpandedFrom(CallInfo)
 }
 
-#[cfg(stage0)]
-impl to_bytes::IterBytes for ExpnInfo {
-    fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
-        match *self {
-            ExpandedFrom(ref call_info) => to_bytes::iter_bytes_2(&0u8, call_info, lsb0, f)
-        }
-    }
-}
-
-#[cfg(not(stage0))]
 impl to_bytes::IterBytes for ExpnInfo {
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
         match *self {
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs
index f897eb787e5..7bf58bc6f32 100644
--- a/src/libsyntax/ext/pipes/proto.rs
+++ b/src/libsyntax/ext/pipes/proto.rs
@@ -100,21 +100,6 @@ pub impl state_ {
 
     /// Iterate over the states that can be reached in one message
     /// from this state.
-    #[cfg(stage0)]
-    fn reachable(&self, f: &fn(state) -> bool) {
-        for self.messages.each |m| {
-            match *m {
-              message(_, _, _, _, Some(next_state { state: ref id, _ })) => {
-                let state = self.proto.get_state((*id));
-                if !f(state) { break }
-              }
-              _ => ()
-            }
-        }
-    }
-    /// Iterate over the states that can be reached in one message
-    /// from this state.
-    #[cfg(not(stage0))]
     fn reachable(&self, f: &fn(state) -> bool) -> bool {
         for self.messages.each |m| {
             match *m {
diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs
index 288e80f6101..e3f1e9e1328 100644
--- a/src/libsyntax/opt_vec.rs
+++ b/src/libsyntax/opt_vec.rs
@@ -130,14 +130,6 @@ impl<A:Eq> Eq for OptVec<A> {
 }
 
 impl<A> BaseIter<A> for OptVec<A> {
-    #[cfg(stage0)]
-    fn each(&self, blk: &fn(v: &A) -> bool) {
-        match *self {
-            Empty => {}
-            Vec(ref v) => v.each(blk)
-        }
-    }
-    #[cfg(not(stage0))]
     fn each(&self, blk: &fn(v: &A) -> bool) -> bool {
         match *self {
             Empty => true,
@@ -152,12 +144,6 @@ impl<A> BaseIter<A> for OptVec<A> {
 
 impl<A> old_iter::ExtendedIter<A> for OptVec<A> {
     #[inline(always)]
-    #[cfg(stage0)]
-    fn eachi(&self, blk: &fn(v: uint, v: &A) -> bool) {
-        old_iter::eachi(self, blk)
-    }
-    #[inline(always)]
-    #[cfg(not(stage0))]
     fn eachi(&self, blk: &fn(v: uint, v: &A) -> bool) -> bool {
         old_iter::eachi(self, blk)
     }
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 859fde90e29..0ce3ab4b3e1 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -64,14 +64,6 @@ pub enum ObsoleteSyntax {
     ObsoleteNamedExternModule,
 }
 
-#[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 {
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 36f241b6427..88fa5389089 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -349,14 +349,6 @@ 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> {
-    #[inline(always)]
-    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> {
     #[inline(always)]
     fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {