Skip to content

Commit a006608

Browse files
committed
Remove stage0 stuff that was awaiting snapshot
and re-register snapshots Just removing unneeded code, no review
1 parent c1fb590 commit a006608

File tree

11 files changed

+9
-739
lines changed

11 files changed

+9
-739
lines changed

src/libcore/at_vec.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,6 @@ pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
135135

136136
#[cfg(notest)]
137137
pub mod traits {
138-
#[legacy_exports];
139-
140-
#[cfg(stage0)]
141-
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
142-
#[inline(always)]
143-
pure fn add(rhs: & &[const T]) -> @[T] {
144-
append(self, (*rhs))
145-
}
146-
}
147-
148-
#[cfg(stage1)]
149-
#[cfg(stage2)]
150138
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
151139
#[inline(always)]
152140
pure fn add(rhs: & &self/[const T]) -> @[T] {
@@ -156,8 +144,7 @@ pub mod traits {
156144
}
157145

158146
#[cfg(test)]
159-
pub mod traits {
160-
#[legacy_exports];}
147+
pub mod traits {}
161148

162149
pub mod raw {
163150
pub type VecRepr = vec::raw::VecRepr;

src/libcore/extfmt.rs

-65
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,13 @@ pub mod ct {
6565
FlagSignAlways,
6666
FlagAlternate,
6767
}
68-
#[cfg(stage0)]
69-
pub enum Count {
70-
CountIs(int),
71-
CountIsParam(int),
72-
CountIsNextParam,
73-
CountImplied,
74-
}
75-
#[cfg(stage1)]
76-
#[cfg(stage2)]
7768
pub enum Count {
7869
CountIs(uint),
7970
CountIsParam(uint),
8071
CountIsNextParam,
8172
CountImplied,
8273
}
8374

84-
#[cfg(stage0)]
85-
pub type Conv =
86-
{param: Option<int>,
87-
flags: ~[Flag],
88-
width: Count,
89-
precision: Count,
90-
ty: Ty};
91-
#[cfg(stage1)]
92-
#[cfg(stage2)]
9375
// A formatted conversion from an expression to a string
9476
pub type Conv =
9577
{param: Option<uint>,
@@ -176,24 +158,6 @@ pub mod ct {
176158
ty: ty.ty}),
177159
next: ty.next};
178160
}
179-
#[cfg(stage0)]
180-
pub fn parse_parameter(s: &str, i: uint, lim: uint) ->
181-
{param: Option<int>, next: uint} {
182-
if i >= lim { return {param: None, next: i}; }
183-
let num = peek_num(s, i, lim);
184-
return match num {
185-
None => {param: None, next: i},
186-
Some(t) => {
187-
let n = t.num as int;
188-
let j = t.next;
189-
if j < lim && s[j] == '$' as u8 {
190-
{param: Some(n), next: j + 1}
191-
} else { {param: None, next: i} }
192-
}
193-
};
194-
}
195-
#[cfg(stage1)]
196-
#[cfg(stage2)]
197161
pub fn parse_parameter(s: &str, i: uint, lim: uint) ->
198162
{param: Option<uint>, next: uint} {
199163
if i >= lim { return {param: None, next: i}; }
@@ -237,31 +201,6 @@ pub mod ct {
237201
more(FlagAlternate, s, i, lim)
238202
} else { {flags: move noflags, next: i} };
239203
}
240-
#[cfg(stage0)]
241-
pub fn parse_count(s: &str, i: uint, lim: uint)
242-
-> {count: Count, next: uint} {
243-
return if i >= lim {
244-
{count: CountImplied, next: i}
245-
} else if s[i] == '*' as u8 {
246-
let param = parse_parameter(s, i + 1, lim);
247-
let j = param.next;
248-
match param.param {
249-
None => {count: CountIsNextParam, next: j},
250-
Some(n) => {count: CountIsParam(n), next: j}
251-
}
252-
} else {
253-
let num = peek_num(s, i, lim);
254-
match num {
255-
None => {count: CountImplied, next: i},
256-
Some(num) => {
257-
count: CountIs(num.num as int),
258-
next: num.next
259-
}
260-
}
261-
};
262-
}
263-
#[cfg(stage1)]
264-
#[cfg(stage2)]
265204
pub fn parse_count(s: &str, i: uint, lim: uint)
266205
-> {count: Count, next: uint} {
267206
return if i >= lim {
@@ -346,10 +285,6 @@ pub mod rt {
346285
pub const flag_sign_always : u32 = 0b00000000001000u32;
347286
pub const flag_alternate : u32 = 0b00000000010000u32;
348287
349-
#[cfg(stage0)]
350-
pub enum Count { CountIs(int), CountImplied, }
351-
#[cfg(stage1)]
352-
#[cfg(stage2)]
353288
pub enum Count { CountIs(uint), CountImplied, }
354289
355290
pub enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }

src/libcore/private.rs

-12
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extern mod rustrt {
2727
#[abi = "rust-intrinsic"]
2828
extern mod rusti {
2929

30-
#[cfg(stage1)] #[cfg(stage2)] #[cfg(stage3)]
3130
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
3231
fn atomic_xadd(dst: &mut int, src: int) -> int;
3332
fn atomic_xsub(dst: &mut int, src: int) -> int;
@@ -38,17 +37,6 @@ type rust_port_id = uint;
3837

3938
type GlobalPtr = *libc::uintptr_t;
4039

41-
// FIXME #3527: Remove once snapshots have atomic_cxchg
42-
#[cfg(stage0)]
43-
fn compare_and_swap(address: &mut libc::uintptr_t,
44-
oldval: libc::uintptr_t,
45-
newval: libc::uintptr_t) -> bool {
46-
rustrt::rust_compare_and_swap_ptr(address, oldval, newval)
47-
}
48-
49-
#[cfg(stage1)]
50-
#[cfg(stage2)]
51-
#[cfg(stage3)]
5240
fn compare_and_swap(address: &mut int, oldval: int, newval: int) -> bool {
5341
let old = rusti::atomic_cxchg(address, oldval, newval);
5442
old == oldval

src/libcore/ptr.rs

-18
Original file line numberDiff line numberDiff line change
@@ -226,30 +226,12 @@ impl<T> *const T : Ord {
226226
}
227227

228228
// Equality for region pointers
229-
#[cfg(stage0)]
230-
impl<T:Eq> &const T : Eq {
231-
pure fn eq(other: & &const T) -> bool { return *self == *(*other); }
232-
pure fn ne(other: & &const T) -> bool { return *self != *(*other); }
233-
}
234-
235-
#[cfg(stage1)]
236-
#[cfg(stage2)]
237229
impl<T:Eq> &const T : Eq {
238230
pure fn eq(other: & &self/const T) -> bool { return *self == *(*other); }
239231
pure fn ne(other: & &self/const T) -> bool { return *self != *(*other); }
240232
}
241233

242234
// Comparison for region pointers
243-
#[cfg(stage0)]
244-
impl<T:Ord> &const T : Ord {
245-
pure fn lt(other: & &const T) -> bool { *self < *(*other) }
246-
pure fn le(other: & &const T) -> bool { *self <= *(*other) }
247-
pure fn ge(other: & &const T) -> bool { *self >= *(*other) }
248-
pure fn gt(other: & &const T) -> bool { *self > *(*other) }
249-
}
250-
251-
#[cfg(stage1)]
252-
#[cfg(stage2)]
253235
impl<T:Ord> &const T : Ord {
254236
pure fn lt(other: & &self/const T) -> bool { *self < *(*other) }
255237
pure fn le(other: & &self/const T) -> bool { *self <= *(*other) }

src/libcore/str.rs

-36
Original file line numberDiff line numberDiff line change
@@ -735,18 +735,6 @@ pure fn gt(a: &str, b: &str) -> bool {
735735
!le(a, b)
736736
}
737737

738-
#[cfg(stage0)]
739-
impl &str : Eq {
740-
#[inline(always)]
741-
pure fn eq(other: & &str) -> bool {
742-
eq_slice(self, (*other))
743-
}
744-
#[inline(always)]
745-
pure fn ne(other: & &str) -> bool { !self.eq(other) }
746-
}
747-
748-
#[cfg(stage1)]
749-
#[cfg(stage2)]
750738
impl &str : Eq {
751739
#[inline(always)]
752740
pure fn eq(other: & &self/str) -> bool {
@@ -785,20 +773,6 @@ impl ~str : Ord {
785773
pure fn gt(other: &~str) -> bool { gt(self, (*other)) }
786774
}
787775

788-
#[cfg(stage0)]
789-
impl &str : Ord {
790-
#[inline(always)]
791-
pure fn lt(other: & &str) -> bool { lt(self, (*other)) }
792-
#[inline(always)]
793-
pure fn le(other: & &str) -> bool { le(self, (*other)) }
794-
#[inline(always)]
795-
pure fn ge(other: & &str) -> bool { ge(self, (*other)) }
796-
#[inline(always)]
797-
pure fn gt(other: & &str) -> bool { gt(self, (*other)) }
798-
}
799-
800-
#[cfg(stage1)]
801-
#[cfg(stage2)]
802776
impl &str : Ord {
803777
#[inline(always)]
804778
pure fn lt(other: & &self/str) -> bool { lt(self, (*other)) }
@@ -2122,16 +2096,6 @@ impl ~str: Trimmable {
21222096

21232097
#[cfg(notest)]
21242098
pub mod traits {
2125-
#[cfg(stage0)]
2126-
impl ~str : Add<&str,~str> {
2127-
#[inline(always)]
2128-
pure fn add(rhs: & &str) -> ~str {
2129-
append(copy self, (*rhs))
2130-
}
2131-
}
2132-
2133-
#[cfg(stage1)]
2134-
#[cfg(stage2)]
21352099
impl ~str : Add<&str,~str> {
21362100
#[inline(always)]
21372101
pure fn add(rhs: & &self/str) -> ~str {

src/libcore/vec.rs

-44
Original file line numberDiff line numberDiff line change
@@ -1317,16 +1317,6 @@ pure fn eq<T: Eq>(a: &[T], b: &[T]) -> bool {
13171317
return true;
13181318
}
13191319

1320-
#[cfg(stage0)]
1321-
impl<T: Eq> &[T] : Eq {
1322-
#[inline(always)]
1323-
pure fn eq(other: & &[T]) -> bool { eq(self, (*other)) }
1324-
#[inline(always)]
1325-
pure fn ne(other: & &[T]) -> bool { !self.eq(other) }
1326-
}
1327-
1328-
#[cfg(stage1)]
1329-
#[cfg(stage2)]
13301320
impl<T: Eq> &[T] : Eq {
13311321
#[inline(always)]
13321322
pure fn eq(other: & &self/[T]) -> bool { eq(self, (*other)) }
@@ -1370,20 +1360,6 @@ pure fn le<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
13701360
pure fn ge<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
13711361
pure fn gt<T: Ord>(a: &[T], b: &[T]) -> bool { lt(b, a) }
13721362

1373-
#[cfg(stage0)]
1374-
impl<T: Ord> &[T] : Ord {
1375-
#[inline(always)]
1376-
pure fn lt(other: & &[T]) -> bool { lt(self, (*other)) }
1377-
#[inline(always)]
1378-
pure fn le(other: & &[T]) -> bool { le(self, (*other)) }
1379-
#[inline(always)]
1380-
pure fn ge(other: & &[T]) -> bool { ge(self, (*other)) }
1381-
#[inline(always)]
1382-
pure fn gt(other: & &[T]) -> bool { gt(self, (*other)) }
1383-
}
1384-
1385-
#[cfg(stage1)]
1386-
#[cfg(stage2)]
13871363
impl<T: Ord> &[T] : Ord {
13881364
#[inline(always)]
13891365
pure fn lt(other: & &self/[T]) -> bool { lt(self, (*other)) }
@@ -1419,33 +1395,13 @@ impl<T: Ord> @[T] : Ord {
14191395

14201396
#[cfg(notest)]
14211397
pub mod traits {
1422-
#[cfg(stage0)]
1423-
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
1424-
#[inline(always)]
1425-
pure fn add(rhs: & &[const T]) -> ~[T] {
1426-
append(copy self, (*rhs))
1427-
}
1428-
}
1429-
1430-
#[cfg(stage1)]
1431-
#[cfg(stage2)]
14321398
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
14331399
#[inline(always)]
14341400
pure fn add(rhs: & &self/[const T]) -> ~[T] {
14351401
append(copy self, (*rhs))
14361402
}
14371403
}
14381404

1439-
#[cfg(stage0)]
1440-
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
1441-
#[inline(always)]
1442-
pure fn add(rhs: & &[const T]) -> ~[mut T] {
1443-
append_mut(copy self, (*rhs))
1444-
}
1445-
}
1446-
1447-
#[cfg(stage1)]
1448-
#[cfg(stage2)]
14491405
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
14501406
#[inline(always)]
14511407
pure fn add(rhs: & &self/[const T]) -> ~[mut T] {

src/libstd/json.rs

-26
Original file line numberDiff line numberDiff line change
@@ -273,32 +273,6 @@ pub impl PrettySerializer: serialization::Serializer {
273273
}
274274
}
275275

276-
#[cfg(stage0)]
277-
pub impl Json: serialization::Serializable {
278-
fn serialize<S: serialization::Serializer>(&self, s: &S) {
279-
match *self {
280-
Number(v) => v.serialize(s),
281-
String(ref v) => v.serialize(s),
282-
Boolean(v) => v.serialize(s),
283-
List(v) => v.serialize(s),
284-
Object(ref v) => {
285-
do s.emit_rec || {
286-
let mut idx = 0;
287-
for v.each |key, value| {
288-
do s.emit_field(*key, idx) {
289-
value.serialize(s);
290-
}
291-
idx += 1;
292-
}
293-
}
294-
},
295-
Null => s.emit_nil(),
296-
}
297-
}
298-
}
299-
300-
#[cfg(stage1)]
301-
#[cfg(stage2)]
302276
pub impl<
303277
S: serialization::Serializer
304278
> Json: serialization::Serializable<S> {

0 commit comments

Comments
 (0)