about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-29 02:56:40 -0700
committerbors <bors@rust-lang.org>2014-03-29 02:56:40 -0700
commitdf9cf18c10099d15146580ab6a2b64f2d2007a89 (patch)
tree259e7a17e182a4d61d68a6878242689a556bae5e /src/libsyntax
parent02d186ad9ba699f7824969fb60a19042613d5d60 (diff)
parenta9c6061c9a542a617020073d0a6b187849d0e348 (diff)
downloadrust-df9cf18c10099d15146580ab6a2b64f2d2007a89.tar.gz
rust-df9cf18c10099d15146580ab6a2b64f2d2007a89.zip
auto merge of #13188 : FlaPer87/rust/master, r=alexcrichton
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs36
-rw-r--r--src/libsyntax/codemap.rs18
-rw-r--r--src/libsyntax/owned_slice.rs17
-rw-r--r--src/libsyntax/parse/mod.rs10
-rw-r--r--src/libsyntax/parse/token.rs17
5 files changed, 0 insertions, 98 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 7c3eb7742d2..8c47e65f234 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -98,29 +98,12 @@ pub type Name = u32;
 /// A mark represents a unique id associated with a macro expansion
 pub type Mrk = u32;
 
-// FIXME: remove stage0 Encodables after snapshot
-#[cfg(stage0)]
-impl<S: Encoder> Encodable<S> for Ident {
-    fn encode(&self, s: &mut S) {
-        s.emit_str(token::get_ident(*self).get());
-    }
-}
-
-#[cfg(stage0)]
-impl<D:Decoder> Decodable<D> for Ident {
-    fn decode(d: &mut D) -> Ident {
-        str_to_ident(d.read_str())
-    }
-}
-
-#[cfg(not(stage0))]
 impl<S: Encoder<E>, E> Encodable<S, E> for Ident {
     fn encode(&self, s: &mut S) -> Result<(), E> {
         s.emit_str(token::get_ident(*self).get())
     }
 }
 
-#[cfg(not(stage0))]
 impl<D:Decoder<E>, E> Decodable<D, E> for Ident {
     fn decode(d: &mut D) -> Result<Ident, E> {
         Ok(str_to_ident(try!(d.read_str())))
@@ -1185,26 +1168,7 @@ mod test {
     use super::*;
 
     // are ASTs encodable?
-    // FIXME: remove stage0 test after snapshot
-    #[test]
-    #[cfg(stage0)]
-    fn check_asts_encodable() {
-        let e = Crate {
-            module: Mod {view_items: Vec::new(), items: Vec::new()},
-            attrs: Vec::new(),
-            config: Vec::new(),
-            span: Span {
-                lo: BytePos(10),
-                hi: BytePos(20),
-                expn_info: None,
-            },
-        };
-        // doesn't matter which encoder we use....
-        let _f = &e as &serialize::Encodable<json::Encoder>;
-    }
-
     #[test]
-    #[cfg(not(stage0))]
     fn check_asts_encodable() {
         use std::io;
         let e = Crate {
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index f3ff7f97ee2..974868c1610 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -110,23 +110,6 @@ impl Eq for Span {
 
 impl TotalEq for Span {}
 
-// FIXME: remove stage0 Encodables/Decodables after snapshot
-#[cfg(stage0)]
-impl<S:Encoder> Encodable<S> for Span {
-    /* Note #1972 -- spans are encoded but not decoded */
-    fn encode(&self, s: &mut S) {
-        s.emit_nil()
-    }
-}
-
-#[cfg(stage0)]
-impl<D:Decoder> Decodable<D> for Span {
-    fn decode(_d: &mut D) -> Span {
-        DUMMY_SP
-    }
-}
-
-#[cfg(not(stage0))]
 impl<S:Encoder<E>, E> Encodable<S, E> for Span {
     /* Note #1972 -- spans are encoded but not decoded */
     fn encode(&self, s: &mut S) -> Result<(), E> {
@@ -134,7 +117,6 @@ impl<S:Encoder<E>, E> Encodable<S, E> for Span {
     }
 }
 
-#[cfg(not(stage0))]
 impl<D:Decoder<E>, E> Decodable<D, E> for Span {
     fn decode(_d: &mut D) -> Result<Span, E> {
         Ok(DUMMY_SP)
diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs
index c4ce3c5cb55..33829212686 100644
--- a/src/libsyntax/owned_slice.rs
+++ b/src/libsyntax/owned_slice.rs
@@ -131,29 +131,12 @@ impl<T> FromIterator<T> for OwnedSlice<T> {
     }
 }
 
-// FIXME: remove stage0 Encodables/Decodables after snapshot
-#[cfg(stage0)]
-impl<S: Encoder, T: Encodable<S>> Encodable<S> for OwnedSlice<T> {
-    fn encode(&self, s: &mut S) {
-       self.as_slice().encode(s)
-    }
-}
-
-#[cfg(stage0)]
-impl<D: Decoder, T: Decodable<D>> Decodable<D> for OwnedSlice<T> {
-    fn decode(d: &mut D) -> OwnedSlice<T> {
-        OwnedSlice::from_vec(Decodable::decode(d))
-    }
-}
-
-#[cfg(not(stage0))]
 impl<S: Encoder<E>, T: Encodable<S, E>, E> Encodable<S, E> for OwnedSlice<T> {
     fn encode(&self, s: &mut S) -> Result<(), E> {
        self.as_slice().encode(s)
     }
 }
 
-#[cfg(not(stage0))]
 impl<D: Decoder<E>, T: Decodable<D, E>, E> Decodable<D, E> for OwnedSlice<T> {
     fn decode(d: &mut D) -> Result<OwnedSlice<T>, E> {
         Ok(OwnedSlice::from_vec(match Decodable::decode(d) {
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index f2a7f543bd6..36f33befb7a 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -288,16 +288,6 @@ mod test {
     use util::parser_testing::{string_to_expr, string_to_item};
     use util::parser_testing::string_to_stmt;
 
-    // FIXME: remove stage0 to_json_str after snapshot
-    #[cfg(stage0)]
-    fn to_json_str<'a, E: Encodable<json::Encoder<'a>>>(val: &E) -> ~str {
-        let mut writer = MemWriter::new();
-        let mut encoder = json::Encoder::new(&mut writer as &mut io::Writer);
-        val.encode(&mut encoder);
-        str::from_utf8_owned(writer.unwrap()).unwrap()
-    }
-
-    #[cfg(not(stage0))]
     fn to_json_str<'a, E: Encodable<json::Encoder<'a>, io::IoError>>(val: &E) -> ~str {
         let mut writer = MemWriter::new();
         let mut encoder = json::Encoder::new(&mut writer as &mut io::Writer);
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index f0b4ebc593a..b7586b5de14 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -604,29 +604,12 @@ impl<'a> Equiv<&'a str> for InternedString {
     }
 }
 
-// FIXME: remove stage0 Encodables/Decodables after snapshot
-#[cfg(stage0)]
-impl<D:Decoder> Decodable<D> for InternedString {
-    fn decode(d: &mut D) -> InternedString {
-        get_name(get_ident_interner().intern(d.read_str()))
-    }
-}
-
-#[cfg(stage0)]
-impl<E:Encoder> Encodable<E> for InternedString {
-    fn encode(&self, e: &mut E) {
-        e.emit_str(self.string.as_slice())
-    }
-}
-
-#[cfg(not(stage0))]
 impl<D:Decoder<E>, E> Decodable<D, E> for InternedString {
     fn decode(d: &mut D) -> Result<InternedString, E> {
         Ok(get_name(get_ident_interner().intern(try!(d.read_str()))))
     }
 }
 
-#[cfg(not(stage0))]
 impl<S:Encoder<E>, E> Encodable<S, E> for InternedString {
     fn encode(&self, s: &mut S) -> Result<(), E> {
         s.emit_str(self.string.as_slice())