about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-12-09 17:59:21 -0800
committerBrian Anderson <banderson@mozilla.com>2012-12-09 17:59:21 -0800
commit9723d3ac2ff5b008d207012ec5d37b2c69f402ed (patch)
tree35ad1b902932e98a5fd959f0615f79acc60589bb
parent55a3a5fcc973663af3694f32be7a4df10a1a2cd1 (diff)
downloadrust-9723d3ac2ff5b008d207012ec5d37b2c69f402ed.tar.gz
rust-9723d3ac2ff5b008d207012ec5d37b2c69f402ed.zip
Remove transitional code
-rw-r--r--src/libcore/at_vec.rs10
-rw-r--r--src/libcore/dvec.rs9
-rw-r--r--src/libcore/ops.rs16
-rw-r--r--src/libcore/str.rs9
-rw-r--r--src/libcore/vec.rs18
-rw-r--r--src/libstd/bitv.rs8
-rw-r--r--src/libstd/ebml.rs10
-rw-r--r--src/libstd/map.rs10
-rw-r--r--src/libstd/smallintmap.rs10
-rw-r--r--src/libsyntax/codemap.rs18
-rw-r--r--src/libsyntax/ext/pipes/ast_builder.rs26
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs109
12 files changed, 0 insertions, 253 deletions
diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs
index 13429c90266..26bae14d160 100644
--- a/src/libcore/at_vec.rs
+++ b/src/libcore/at_vec.rs
@@ -145,16 +145,6 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
 
 #[cfg(notest)]
 pub mod traits {
-    #[cfg(stage0)]
-    pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
-        #[inline(always)]
-        pure fn add(rhs: & &self/[const T]) -> @[T] {
-            append(self, (*rhs))
-        }
-    }
-
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
         #[inline(always)]
         pure fn add(&self, rhs: & &self/[const T]) -> @[T] {
diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs
index b3da5f1e98b..874a36eb9f0 100644
--- a/src/libcore/dvec.rs
+++ b/src/libcore/dvec.rs
@@ -358,15 +358,6 @@ impl<A: Copy> DVec<A> {
     }
 }
 
-#[cfg(stage0)]
-impl<A:Copy> DVec<A>: Index<uint,A> {
-    #[inline(always)]
-    pure fn index(idx: uint) -> A {
-        self.get_elt(idx)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl<A:Copy> DVec<A>: Index<uint,A> {
     #[inline(always)]
     pure fn index(&self, idx: uint) -> A {
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 71d4b297252..3c6f5638d8d 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -18,14 +18,6 @@ pub trait Drop {
     fn finalize(&self);  // XXX: Rename to "drop"? --pcwalton
 }
 
-#[cfg(stage0)]
-#[lang="add"]
-pub trait Add<RHS,Result> {
-    pure fn add(rhs: &RHS) -> Result;
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 #[lang="add"]
 pub trait Add<RHS,Result> {
     pure fn add(&self, rhs: &RHS) -> Result;
@@ -81,14 +73,6 @@ pub trait Shr<RHS,Result> {
     pure fn shr(&self, rhs: &RHS) -> Result;
 }
 
-#[cfg(stage0)]
-#[lang="index"]
-pub trait Index<Index,Result> {
-    pure fn index(index: Index) -> Result;
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 #[lang="index"]
 pub trait Index<Index,Result> {
     pure fn index(&self, index: Index) -> Result;
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 40a8f9afd67..e8ed35029d3 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -2107,15 +2107,6 @@ impl ~str: Trimmable {
 
 #[cfg(notest)]
 pub mod traits {
-    #[cfg(stage0)]
-    impl ~str : Add<&str,~str> {
-        #[inline(always)]
-        pure fn add(rhs: & &self/str) -> ~str {
-            append(copy self, (*rhs))
-        }
-    }
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     impl ~str : Add<&str,~str> {
         #[inline(always)]
         pure fn add(&self, rhs: & &self/str) -> ~str {
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 8b6cb2ade5e..3386214ce13 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -1439,15 +1439,6 @@ impl<T: Ord> @[T] : Ord {
 
 #[cfg(notest)]
 pub mod traits {
-    #[cfg(stage0)]
-    impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
-        #[inline(always)]
-        pure fn add(rhs: & &self/[const T]) -> ~[T] {
-            append(copy self, (*rhs))
-        }
-    }
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
         #[inline(always)]
         pure fn add(&self, rhs: & &self/[const T]) -> ~[T] {
@@ -1455,15 +1446,6 @@ pub mod traits {
         }
     }
 
-    #[cfg(stage0)]
-    impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
-        #[inline(always)]
-        pure fn add(rhs: & &self/[const T]) -> ~[mut T] {
-            append_mut(copy self, (*rhs))
-        }
-    }
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
         #[inline(always)]
         pure fn add(&self, rhs: & &self/[const T]) -> ~[mut T] {
diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs
index 72f21a687da..5b9dc6cf3a8 100644
--- a/src/libstd/bitv.rs
+++ b/src/libstd/bitv.rs
@@ -565,14 +565,6 @@ pure fn land(w0: uint, w1: uint) -> uint { return w0 & w1; }
 
 pure fn right(_w0: uint, w1: uint) -> uint { return w1; }
 
-#[cfg(stage0)]
-impl Bitv: ops::Index<uint,bool> {
-    pure fn index(i: uint) -> bool {
-        self.get(i)
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl Bitv: ops::Index<uint,bool> {
     pure fn index(&self, i: uint) -> bool {
         self.get(i)
diff --git a/src/libstd/ebml.rs b/src/libstd/ebml.rs
index 164021783d1..d439eef7cce 100644
--- a/src/libstd/ebml.rs
+++ b/src/libstd/ebml.rs
@@ -57,16 +57,6 @@ pub mod reader {
 
     // ebml reading
 
-    #[cfg(stage0)]
-    impl Doc: ops::Index<uint,Doc> {
-        pure fn index(tag: uint) -> Doc {
-            unsafe {
-                get_doc(self, tag)
-            }
-        }
-    }
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     impl Doc: ops::Index<uint,Doc> {
         pure fn index(&self, tag: uint) -> Doc {
             unsafe {
diff --git a/src/libstd/map.rs b/src/libstd/map.rs
index add1976539c..39124dfbfba 100644
--- a/src/libstd/map.rs
+++ b/src/libstd/map.rs
@@ -429,16 +429,6 @@ pub mod chained {
         }
     }
 
-    #[cfg(stage0)]
-    impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: ops::Index<K, V> {
-        pure fn index(k: K) -> V {
-            unsafe {
-                self.get(k)
-            }
-        }
-    }
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: ops::Index<K, V> {
         pure fn index(&self, k: K) -> V {
             unsafe {
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs
index 3e82c3c9419..b16cf99cb4e 100644
--- a/src/libstd/smallintmap.rs
+++ b/src/libstd/smallintmap.rs
@@ -150,16 +150,6 @@ impl<V: Copy> SmallIntMap<V>: map::Map<uint, V> {
     }
 }
 
-#[cfg(stage0)]
-impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
-    pure fn index(key: uint) -> V {
-        unsafe {
-            get(self, key)
-        }
-    }
-}
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
     pure fn index(&self, key: uint) -> V {
         unsafe {
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 2473011be0d..6481785e61a 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -59,15 +59,6 @@ impl BytePos: cmp::Ord {
     pure fn gt(&self, other: &BytePos) -> bool { **self > **other }
 }
 
-#[cfg(stage0)]
-impl BytePos: Add<BytePos, BytePos> {
-    pure fn add(rhs: &BytePos) -> BytePos {
-        BytePos(*self + **rhs)
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl BytePos: Add<BytePos, BytePos> {
     pure fn add(&self, rhs: &BytePos) -> BytePos {
         BytePos(**self + **rhs)
@@ -109,15 +100,6 @@ impl CharPos: to_bytes::IterBytes {
     }
 }
 
-#[cfg(stage0)]
-impl CharPos: Add<CharPos, CharPos> {
-    pure fn add(rhs: &CharPos) -> CharPos {
-        CharPos(*self + **rhs)
-    }
-}
-
-#[cfg(stage1)]
-#[cfg(stage2)]
 impl CharPos: Add<CharPos, CharPos> {
     pure fn add(&self, rhs: &CharPos) -> CharPos {
         CharPos(**self + **rhs)
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs
index 66d9e44ba2e..2a7b09795ce 100644
--- a/src/libsyntax/ext/pipes/ast_builder.rs
+++ b/src/libsyntax/ext/pipes/ast_builder.rs
@@ -122,32 +122,6 @@ impl ext_ctxt: ext_ctxt_ast_builder {
           span: dummy_sp()}
     }
 
-    #[cfg(stage0)]
-    fn stmt_let(ident: ident, e: @ast::expr) -> @ast::stmt {
-        // If the quasiquoter could interpolate idents, this is all
-        // we'd need.
-        //
-        //let ext_cx = self;
-        //#ast[stmt] { let $(ident) = $(e) }
-
-        @{node: ast::stmt_decl(@{node: ast::decl_local(~[
-            @{node: {is_mutbl: false,
-                     ty: self.ty_infer(),
-                     pat: @{id: self.next_id(),
-                            node: ast::pat_ident(ast::bind_infer,
-                                                 path(~[ident],
-                                                      dummy_sp()),
-                                                 None),
-                            span: dummy_sp()},
-                     init: Some(self.move_expr(e)),
-                     id: self.next_id()},
-              span: dummy_sp()}]),
-                               span: dummy_sp()}, self.next_id()),
-         span: dummy_sp()}
-     }
-
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     fn stmt_let(ident: ident, e: @ast::expr) -> @ast::stmt {
         let ext_cx = self;
         quote_stmt!( let $ident = $e; )
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 822480f0ad6..5ce3898b3e8 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -302,47 +302,6 @@ impl state: to_type_decls {
 
 impl protocol: gen_init {
 
-    #[cfg(stage0)]
-    fn gen_init(cx: ext_ctxt) -> @ast::item {
-        let ext_cx = cx;
-
-        debug!("gen_init");
-        let start_state = self.states[0];
-
-        let body = if !self.is_bounded() {
-            match start_state.dir {
-              send => #ast { pipes::entangle() },
-              recv => {
-                #ast {{
-                    let (s, c) = pipes::entangle();
-                    (move c, move s)
-                }}
-              }
-            }
-        }
-        else {
-            let body = self.gen_init_bounded(ext_cx);
-            match start_state.dir {
-              send => body,
-              recv => {
-                #ast {{
-                    let (s, c) = $(body);
-                    (move c, move s)
-                }}
-              }
-            }
-        };
-
-        cx.parse_item(fmt!("pub fn init%s() -> (client::%s, server::%s)\
-                            { use pipes::HasBuffer; %s }",
-                           start_state.ty_params.to_source(cx),
-                           start_state.to_ty(cx).to_source(cx),
-                           start_state.to_ty(cx).to_source(cx),
-                           body.to_source(cx)))
-    }
-
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     fn gen_init(cx: ext_ctxt) -> @ast::item {
         let ext_cx = cx;
 
@@ -381,17 +340,6 @@ impl protocol: gen_init {
                            body.to_source(cx)))
     }
 
-    #[cfg(stage0)]
-    fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr {
-        ext_cx.rec(self.states.map_to_vec(|s| {
-            let fty = s.to_ty(ext_cx);
-            ext_cx.field_imm(ext_cx.ident_of(s.name),
-                             #ast { pipes::mk_packet::<$(fty)>() })
-        }))
-    }
-
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr {
         ext_cx.rec(self.states.map_to_vec(|s| {
             let fty = s.to_ty(ext_cx);
@@ -402,35 +350,6 @@ impl protocol: gen_init {
         }))
     }
 
-    #[cfg(stage0)]
-    fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr {
-        debug!("gen_init_bounded");
-        let buffer_fields = self.gen_buffer_init(ext_cx);
-        let buffer = #ast {
-            ~{header: pipes::BufferHeader(),
-              data: $(buffer_fields)}
-        };
-
-        let entangle_body = ext_cx.block_expr(
-            ext_cx.block(
-                self.states.map_to_vec(
-                    |s| ext_cx.parse_stmt(
-                        fmt!("data.%s.set_buffer_(buffer)",
-                             s.name))),
-                ext_cx.parse_expr(
-                    fmt!("ptr::addr_of(&(data.%s))",
-                         self.states[0].name))));
-
-        #ast {{
-            let buffer = $(buffer);
-            do pipes::entangle_buffer(move buffer) |buffer, data| {
-                $(entangle_body)
-            }
-        }}
-    }
-
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr {
         debug!("gen_init_bounded");
         let buffer_fields = self.gen_buffer_init(ext_cx);
@@ -472,34 +391,6 @@ impl protocol: gen_init {
                                .add_tys(cx.ty_vars(params)))
     }
 
-    #[cfg(stage0)]
-    fn gen_buffer_type(cx: ext_ctxt) -> @ast::item {
-        let ext_cx = cx;
-        let mut params: ~[ast::ty_param] = ~[];
-        let fields = do (copy self.states).map_to_vec |s| {
-            for s.ty_params.each |tp| {
-                match params.find(|tpp| tp.ident == tpp.ident) {
-                  None => params.push(*tp),
-                  _ => ()
-                }
-            }
-            let ty = s.to_ty(cx);
-            let fty = #ast[ty] {
-                pipes::Packet<$(ty)>
-            };
-
-            cx.ty_field_imm(cx.ident_of(s.name), fty)
-        };
-
-        cx.item_ty_poly(
-            cx.ident_of(~"__Buffer"),
-            dummy_sp(),
-            cx.ty_rec(fields),
-            params)
-    }
-
-    #[cfg(stage1)]
-    #[cfg(stage2)]
     fn gen_buffer_type(cx: ext_ctxt) -> @ast::item {
         let ext_cx = cx;
         let mut params: ~[ast::ty_param] = ~[];