Skip to content

Commit 9723d3a

Browse files
committed
Remove transitional code
1 parent 55a3a5f commit 9723d3a

File tree

12 files changed

+0
-253
lines changed

12 files changed

+0
-253
lines changed

src/libcore/at_vec.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,6 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
145145

146146
#[cfg(notest)]
147147
pub mod traits {
148-
#[cfg(stage0)]
149-
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
150-
#[inline(always)]
151-
pure fn add(rhs: & &self/[const T]) -> @[T] {
152-
append(self, (*rhs))
153-
}
154-
}
155-
156-
#[cfg(stage1)]
157-
#[cfg(stage2)]
158148
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
159149
#[inline(always)]
160150
pure fn add(&self, rhs: & &self/[const T]) -> @[T] {

src/libcore/dvec.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,6 @@ impl<A: Copy> DVec<A> {
358358
}
359359
}
360360

361-
#[cfg(stage0)]
362-
impl<A:Copy> DVec<A>: Index<uint,A> {
363-
#[inline(always)]
364-
pure fn index(idx: uint) -> A {
365-
self.get_elt(idx)
366-
}
367-
}
368-
#[cfg(stage1)]
369-
#[cfg(stage2)]
370361
impl<A:Copy> DVec<A>: Index<uint,A> {
371362
#[inline(always)]
372363
pure fn index(&self, idx: uint) -> A {

src/libcore/ops.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ pub trait Drop {
1818
fn finalize(&self); // XXX: Rename to "drop"? --pcwalton
1919
}
2020

21-
#[cfg(stage0)]
22-
#[lang="add"]
23-
pub trait Add<RHS,Result> {
24-
pure fn add(rhs: &RHS) -> Result;
25-
}
26-
27-
#[cfg(stage1)]
28-
#[cfg(stage2)]
2921
#[lang="add"]
3022
pub trait Add<RHS,Result> {
3123
pure fn add(&self, rhs: &RHS) -> Result;
@@ -81,14 +73,6 @@ pub trait Shr<RHS,Result> {
8173
pure fn shr(&self, rhs: &RHS) -> Result;
8274
}
8375

84-
#[cfg(stage0)]
85-
#[lang="index"]
86-
pub trait Index<Index,Result> {
87-
pure fn index(index: Index) -> Result;
88-
}
89-
90-
#[cfg(stage1)]
91-
#[cfg(stage2)]
9276
#[lang="index"]
9377
pub trait Index<Index,Result> {
9478
pure fn index(&self, index: Index) -> Result;

src/libcore/str.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,15 +2107,6 @@ impl ~str: Trimmable {
21072107

21082108
#[cfg(notest)]
21092109
pub mod traits {
2110-
#[cfg(stage0)]
2111-
impl ~str : Add<&str,~str> {
2112-
#[inline(always)]
2113-
pure fn add(rhs: & &self/str) -> ~str {
2114-
append(copy self, (*rhs))
2115-
}
2116-
}
2117-
#[cfg(stage1)]
2118-
#[cfg(stage2)]
21192110
impl ~str : Add<&str,~str> {
21202111
#[inline(always)]
21212112
pure fn add(&self, rhs: & &self/str) -> ~str {

src/libcore/vec.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,31 +1439,13 @@ impl<T: Ord> @[T] : Ord {
14391439

14401440
#[cfg(notest)]
14411441
pub mod traits {
1442-
#[cfg(stage0)]
1443-
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
1444-
#[inline(always)]
1445-
pure fn add(rhs: & &self/[const T]) -> ~[T] {
1446-
append(copy self, (*rhs))
1447-
}
1448-
}
1449-
#[cfg(stage1)]
1450-
#[cfg(stage2)]
14511442
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
14521443
#[inline(always)]
14531444
pure fn add(&self, rhs: & &self/[const T]) -> ~[T] {
14541445
append(copy *self, (*rhs))
14551446
}
14561447
}
14571448

1458-
#[cfg(stage0)]
1459-
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
1460-
#[inline(always)]
1461-
pure fn add(rhs: & &self/[const T]) -> ~[mut T] {
1462-
append_mut(copy self, (*rhs))
1463-
}
1464-
}
1465-
#[cfg(stage1)]
1466-
#[cfg(stage2)]
14671449
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
14681450
#[inline(always)]
14691451
pure fn add(&self, rhs: & &self/[const T]) -> ~[mut T] {

src/libstd/bitv.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,6 @@ pure fn land(w0: uint, w1: uint) -> uint { return w0 & w1; }
565565

566566
pure fn right(_w0: uint, w1: uint) -> uint { return w1; }
567567

568-
#[cfg(stage0)]
569-
impl Bitv: ops::Index<uint,bool> {
570-
pure fn index(i: uint) -> bool {
571-
self.get(i)
572-
}
573-
}
574-
#[cfg(stage1)]
575-
#[cfg(stage2)]
576568
impl Bitv: ops::Index<uint,bool> {
577569
pure fn index(&self, i: uint) -> bool {
578570
self.get(i)

src/libstd/ebml.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ pub mod reader {
5757

5858
// ebml reading
5959

60-
#[cfg(stage0)]
61-
impl Doc: ops::Index<uint,Doc> {
62-
pure fn index(tag: uint) -> Doc {
63-
unsafe {
64-
get_doc(self, tag)
65-
}
66-
}
67-
}
68-
#[cfg(stage1)]
69-
#[cfg(stage2)]
7060
impl Doc: ops::Index<uint,Doc> {
7161
pure fn index(&self, tag: uint) -> Doc {
7262
unsafe {

src/libstd/map.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,16 +429,6 @@ pub mod chained {
429429
}
430430
}
431431

432-
#[cfg(stage0)]
433-
impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: ops::Index<K, V> {
434-
pure fn index(k: K) -> V {
435-
unsafe {
436-
self.get(k)
437-
}
438-
}
439-
}
440-
#[cfg(stage1)]
441-
#[cfg(stage2)]
442432
impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: ops::Index<K, V> {
443433
pure fn index(&self, k: K) -> V {
444434
unsafe {

src/libstd/smallintmap.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,6 @@ impl<V: Copy> SmallIntMap<V>: map::Map<uint, V> {
150150
}
151151
}
152152

153-
#[cfg(stage0)]
154-
impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
155-
pure fn index(key: uint) -> V {
156-
unsafe {
157-
get(self, key)
158-
}
159-
}
160-
}
161-
#[cfg(stage1)]
162-
#[cfg(stage2)]
163153
impl<V: Copy> SmallIntMap<V>: ops::Index<uint, V> {
164154
pure fn index(&self, key: uint) -> V {
165155
unsafe {

src/libsyntax/codemap.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ impl BytePos: cmp::Ord {
5959
pure fn gt(&self, other: &BytePos) -> bool { **self > **other }
6060
}
6161

62-
#[cfg(stage0)]
63-
impl BytePos: Add<BytePos, BytePos> {
64-
pure fn add(rhs: &BytePos) -> BytePos {
65-
BytePos(*self + **rhs)
66-
}
67-
}
68-
69-
#[cfg(stage1)]
70-
#[cfg(stage2)]
7162
impl BytePos: Add<BytePos, BytePos> {
7263
pure fn add(&self, rhs: &BytePos) -> BytePos {
7364
BytePos(**self + **rhs)
@@ -109,15 +100,6 @@ impl CharPos: to_bytes::IterBytes {
109100
}
110101
}
111102

112-
#[cfg(stage0)]
113-
impl CharPos: Add<CharPos, CharPos> {
114-
pure fn add(rhs: &CharPos) -> CharPos {
115-
CharPos(*self + **rhs)
116-
}
117-
}
118-
119-
#[cfg(stage1)]
120-
#[cfg(stage2)]
121103
impl CharPos: Add<CharPos, CharPos> {
122104
pure fn add(&self, rhs: &CharPos) -> CharPos {
123105
CharPos(**self + **rhs)

src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -122,32 +122,6 @@ impl ext_ctxt: ext_ctxt_ast_builder {
122122
span: dummy_sp()}
123123
}
124124

125-
#[cfg(stage0)]
126-
fn stmt_let(ident: ident, e: @ast::expr) -> @ast::stmt {
127-
// If the quasiquoter could interpolate idents, this is all
128-
// we'd need.
129-
//
130-
//let ext_cx = self;
131-
//#ast[stmt] { let $(ident) = $(e) }
132-
133-
@{node: ast::stmt_decl(@{node: ast::decl_local(~[
134-
@{node: {is_mutbl: false,
135-
ty: self.ty_infer(),
136-
pat: @{id: self.next_id(),
137-
node: ast::pat_ident(ast::bind_infer,
138-
path(~[ident],
139-
dummy_sp()),
140-
None),
141-
span: dummy_sp()},
142-
init: Some(self.move_expr(e)),
143-
id: self.next_id()},
144-
span: dummy_sp()}]),
145-
span: dummy_sp()}, self.next_id()),
146-
span: dummy_sp()}
147-
}
148-
149-
#[cfg(stage1)]
150-
#[cfg(stage2)]
151125
fn stmt_let(ident: ident, e: @ast::expr) -> @ast::stmt {
152126
let ext_cx = self;
153127
quote_stmt!( let $ident = $e; )

src/libsyntax/ext/pipes/pipec.rs

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -302,47 +302,6 @@ impl state: to_type_decls {
302302
303303
impl protocol: gen_init {
304304
305-
#[cfg(stage0)]
306-
fn gen_init(cx: ext_ctxt) -> @ast::item {
307-
let ext_cx = cx;
308-
309-
debug!("gen_init");
310-
let start_state = self.states[0];
311-
312-
let body = if !self.is_bounded() {
313-
match start_state.dir {
314-
send => #ast { pipes::entangle() },
315-
recv => {
316-
#ast {{
317-
let (s, c) = pipes::entangle();
318-
(move c, move s)
319-
}}
320-
}
321-
}
322-
}
323-
else {
324-
let body = self.gen_init_bounded(ext_cx);
325-
match start_state.dir {
326-
send => body,
327-
recv => {
328-
#ast {{
329-
let (s, c) = $(body);
330-
(move c, move s)
331-
}}
332-
}
333-
}
334-
};
335-
336-
cx.parse_item(fmt!("pub fn init%s() -> (client::%s, server::%s)\
337-
{ use pipes::HasBuffer; %s }",
338-
start_state.ty_params.to_source(cx),
339-
start_state.to_ty(cx).to_source(cx),
340-
start_state.to_ty(cx).to_source(cx),
341-
body.to_source(cx)))
342-
}
343-
344-
#[cfg(stage1)]
345-
#[cfg(stage2)]
346305
fn gen_init(cx: ext_ctxt) -> @ast::item {
347306
let ext_cx = cx;
348307
@@ -381,17 +340,6 @@ impl protocol: gen_init {
381340
body.to_source(cx)))
382341
}
383342
384-
#[cfg(stage0)]
385-
fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr {
386-
ext_cx.rec(self.states.map_to_vec(|s| {
387-
let fty = s.to_ty(ext_cx);
388-
ext_cx.field_imm(ext_cx.ident_of(s.name),
389-
#ast { pipes::mk_packet::<$(fty)>() })
390-
}))
391-
}
392-
393-
#[cfg(stage1)]
394-
#[cfg(stage2)]
395343
fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr {
396344
ext_cx.rec(self.states.map_to_vec(|s| {
397345
let fty = s.to_ty(ext_cx);
@@ -402,35 +350,6 @@ impl protocol: gen_init {
402350
}))
403351
}
404352
405-
#[cfg(stage0)]
406-
fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr {
407-
debug!("gen_init_bounded");
408-
let buffer_fields = self.gen_buffer_init(ext_cx);
409-
let buffer = #ast {
410-
~{header: pipes::BufferHeader(),
411-
data: $(buffer_fields)}
412-
};
413-
414-
let entangle_body = ext_cx.block_expr(
415-
ext_cx.block(
416-
self.states.map_to_vec(
417-
|s| ext_cx.parse_stmt(
418-
fmt!("data.%s.set_buffer_(buffer)",
419-
s.name))),
420-
ext_cx.parse_expr(
421-
fmt!("ptr::addr_of(&(data.%s))",
422-
self.states[0].name))));
423-
424-
#ast {{
425-
let buffer = $(buffer);
426-
do pipes::entangle_buffer(move buffer) |buffer, data| {
427-
$(entangle_body)
428-
}
429-
}}
430-
}
431-
432-
#[cfg(stage1)]
433-
#[cfg(stage2)]
434353
fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr {
435354
debug!("gen_init_bounded");
436355
let buffer_fields = self.gen_buffer_init(ext_cx);
@@ -472,34 +391,6 @@ impl protocol: gen_init {
472391
.add_tys(cx.ty_vars(params)))
473392
}
474393
475-
#[cfg(stage0)]
476-
fn gen_buffer_type(cx: ext_ctxt) -> @ast::item {
477-
let ext_cx = cx;
478-
let mut params: ~[ast::ty_param] = ~[];
479-
let fields = do (copy self.states).map_to_vec |s| {
480-
for s.ty_params.each |tp| {
481-
match params.find(|tpp| tp.ident == tpp.ident) {
482-
None => params.push(*tp),
483-
_ => ()
484-
}
485-
}
486-
let ty = s.to_ty(cx);
487-
let fty = #ast[ty] {
488-
pipes::Packet<$(ty)>
489-
};
490-
491-
cx.ty_field_imm(cx.ident_of(s.name), fty)
492-
};
493-
494-
cx.item_ty_poly(
495-
cx.ident_of(~"__Buffer"),
496-
dummy_sp(),
497-
cx.ty_rec(fields),
498-
params)
499-
}
500-
501-
#[cfg(stage1)]
502-
#[cfg(stage2)]
503394
fn gen_buffer_type(cx: ext_ctxt) -> @ast::item {
504395
let ext_cx = cx;
505396
let mut params: ~[ast::ty_param] = ~[];

0 commit comments

Comments
 (0)