libs: Remove transitionary material on iter_bytes, add workcache to build.

This commit is contained in:
Graydon Hoare 2012-11-30 10:33:16 -08:00
parent 38ba2c4941
commit d783f4d7bb
13 changed files with 1 additions and 885 deletions

View File

@ -19,7 +19,6 @@ pub type Cb = fn(buf: &[const u8]) -> bool;
* modified when default methods and trait inheritence are
* completed.
*/
#[cfg(stage0)]
pub trait IterBytes {
/**
* Call the provided callback `f` one or more times with
@ -35,27 +34,9 @@ pub trait IterBytes {
* left-to-right in declaration order, regardless of
* underlying memory endianness.
*/
pure fn iter_bytes(lsb0: bool, f: Cb);
}
#[cfg(stage1)]
#[cfg(stage2)]
pub trait IterBytes {
pure fn iter_bytes(&self, lsb0: bool, f: Cb);
}
#[cfg(stage0)]
impl bool: IterBytes {
#[inline(always)]
pure fn iter_bytes(_lsb0: bool, f: Cb) {
f([
self as u8
]);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl bool: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, _lsb0: bool, f: Cb) {
@ -65,18 +46,6 @@ impl bool: IterBytes {
}
}
#[cfg(stage0)]
impl u8: IterBytes {
#[inline(always)]
pure fn iter_bytes(_lsb0: bool, f: Cb) {
f([
self
]);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl u8: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, _lsb0: bool, f: Cb) {
@ -86,26 +55,6 @@ impl u8: IterBytes {
}
}
#[cfg(stage0)]
impl u16: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
if lsb0 {
f([
self as u8,
(self >> 8) as u8
]);
} else {
f([
(self >> 8) as u8,
self as u8
]);
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl u16: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -123,30 +72,6 @@ impl u16: IterBytes {
}
}
#[cfg(stage0)]
impl u32: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
if lsb0 {
f([
self as u8,
(self >> 8) as u8,
(self >> 16) as u8,
(self >> 24) as u8,
]);
} else {
f([
(self >> 24) as u8,
(self >> 16) as u8,
(self >> 8) as u8,
self as u8
]);
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl u32: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -168,38 +93,6 @@ impl u32: IterBytes {
}
}
#[cfg(stage0)]
impl u64: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
if lsb0 {
f([
self as u8,
(self >> 8) as u8,
(self >> 16) as u8,
(self >> 24) as u8,
(self >> 32) as u8,
(self >> 40) as u8,
(self >> 48) as u8,
(self >> 56) as u8
]);
} else {
f([
(self >> 56) as u8,
(self >> 48) as u8,
(self >> 40) as u8,
(self >> 32) as u8,
(self >> 24) as u8,
(self >> 16) as u8,
(self >> 8) as u8,
self as u8
]);
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl u64: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -229,16 +122,6 @@ impl u64: IterBytes {
}
}
#[cfg(stage0)]
impl i8: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl i8: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -246,16 +129,6 @@ impl i8: IterBytes {
}
}
#[cfg(stage0)]
impl i16: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u16).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl i16: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -263,16 +136,6 @@ impl i16: IterBytes {
}
}
#[cfg(stage0)]
impl i32: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u32).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl i32: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -280,16 +143,6 @@ impl i32: IterBytes {
}
}
#[cfg(stage0)]
impl i64: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u64).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl i64: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -297,16 +150,6 @@ impl i64: IterBytes {
}
}
#[cfg(stage0)]
impl char: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u32).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl char: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -316,16 +159,6 @@ impl char: IterBytes {
#[cfg(target_word_size = "32")]
pub mod x32 {
#[cfg(stage0)]
pub impl uint: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u32).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
pub impl uint: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -336,16 +169,6 @@ pub mod x32 {
#[cfg(target_word_size = "64")]
pub mod x64 {
#[cfg(stage0)]
pub impl uint: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as u64).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
pub impl uint: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -354,16 +177,6 @@ pub mod x64 {
}
}
#[cfg(stage0)]
impl int: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as uint).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl int: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -371,20 +184,6 @@ impl int: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes> &[A]: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
for self.each |elt| {
do elt.iter_bytes(lsb0) |bytes| {
f(bytes)
}
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> &[A]: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -396,18 +195,6 @@ impl<A: IterBytes> &[A]: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
let &(ref a, ref b) = &self;
a.iter_bytes(lsb0, f);
b.iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -417,19 +204,6 @@ impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
let &(ref a, ref b, ref c) = &self;
a.iter_bytes(lsb0, f);
b.iter_bytes(lsb0, f);
c.iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -445,16 +219,6 @@ pure fn borrow<A>(a: &x/[A]) -> &x/[A] {
a
}
#[cfg(stage0)]
impl<A: IterBytes> ~[A]: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
borrow(self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> ~[A]: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -462,16 +226,6 @@ impl<A: IterBytes> ~[A]: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes> @[A]: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
borrow(self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> @[A]: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -582,18 +336,6 @@ pub pure fn iter_bytes_7<A: IterBytes,
g.iter_bytes(lsb0, |bytes| {flag = z(bytes); flag});
}
#[cfg(stage0)]
impl &str: IterBytes {
#[inline(always)]
pure fn iter_bytes(_lsb0: bool, f: Cb) {
do str::byte_slice(self) |bytes| {
f(bytes);
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl &str: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, _lsb0: bool, f: Cb) {
@ -603,18 +345,6 @@ impl &str: IterBytes {
}
}
#[cfg(stage0)]
impl ~str: IterBytes {
#[inline(always)]
pure fn iter_bytes(_lsb0: bool, f: Cb) {
do str::byte_slice(self) |bytes| {
f(bytes);
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl ~str: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, _lsb0: bool, f: Cb) {
@ -624,18 +354,6 @@ impl ~str: IterBytes {
}
}
#[cfg(stage0)]
impl @str: IterBytes {
#[inline(always)]
pure fn iter_bytes(_lsb0: bool, f: Cb) {
do str::byte_slice(self) |bytes| {
f(bytes);
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl @str: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, _lsb0: bool, f: Cb) {
@ -645,19 +363,6 @@ impl @str: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes> Option<A>: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
match self {
Some(ref a) => iter_bytes_2(&0u8, a, lsb0, f),
None => 1u8.iter_bytes(lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> Option<A>: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -668,16 +373,6 @@ impl<A: IterBytes> Option<A>: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes> &A: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(*self).iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> &A: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -685,16 +380,6 @@ impl<A: IterBytes> &A: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes> @A: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(*self).iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> @A: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -702,16 +387,6 @@ impl<A: IterBytes> @A: IterBytes {
}
}
#[cfg(stage0)]
impl<A: IterBytes> ~A: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(*self).iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<A: IterBytes> ~A: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
@ -719,18 +394,8 @@ impl<A: IterBytes> ~A: IterBytes {
}
}
#[cfg(stage0)]
impl<A> *const A: IterBytes {
#[inline(always)]
pure fn iter_bytes(lsb0: bool, f: Cb) {
(self as uint).iter_bytes(lsb0, f);
}
}
// NB: raw-pointer IterBytes does _not_ dereference
// to the target; it just gives you the pointer-bytes.
#[cfg(stage1)]
#[cfg(stage2)]
impl<A> *const A: IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {

View File

@ -424,14 +424,6 @@ impl root_map_key : cmp::Eq {
}
}
#[cfg(stage0)]
impl root_map_key : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.id, &self.derefs, lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl root_map_key : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.id, &self.derefs, lsb0, f);

View File

@ -1170,22 +1170,6 @@ impl mono_id_ : cmp::Eq {
pure fn ne(&self, other: &mono_id_) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl mono_param_id : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
mono_precise(t, mids) =>
to_bytes::iter_bytes_3(&0u8, &ty::type_id(t), &mids, lsb0, f),
mono_any => 1u8.iter_bytes(lsb0, f),
mono_repr(ref a, ref b, ref c, ref d) =>
to_bytes::iter_bytes_5(&2u8, a, b, c, d, lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl mono_param_id : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -1200,14 +1184,6 @@ impl mono_param_id : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl mono_id_ : core::to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl mono_id_ : core::to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);

View File

@ -145,14 +145,6 @@ impl DatumMode: cmp::Eq {
pure fn ne(&self, other: &DatumMode) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl DatumMode: to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as uint).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl DatumMode: to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as uint).iter_bytes(lsb0, f)

View File

@ -258,14 +258,6 @@ impl creader_cache_key : cmp::Eq {
}
}
#[cfg(stage0)]
impl creader_cache_key : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_3(&self.cnum, &self.pos, &self.len, lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl creader_cache_key : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_3(&self.cnum, &self.pos, &self.len, lsb0, f);
@ -281,14 +273,6 @@ impl intern_key : cmp::Eq {
pure fn ne(&self, other: &intern_key) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl intern_key : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.sty, &self.o_def_id, lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl intern_key : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.sty, &self.o_def_id, lsb0, f);
@ -531,14 +515,6 @@ impl param_ty : cmp::Eq {
pure fn ne(&self, other: &param_ty) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl param_ty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.idx, &self.def_id, lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl param_ty : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.idx, &self.def_id, lsb0, f)
@ -725,18 +701,6 @@ enum InferTy {
FloatVar(FloatVid)
}
#[cfg(stage0)]
impl InferTy : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
TyVar(ref tv) => to_bytes::iter_bytes_2(&0u8, tv, lsb0, f),
IntVar(ref iv) => to_bytes::iter_bytes_2(&1u8, iv, lsb0, f),
FloatVar(ref fv) => to_bytes::iter_bytes_2(&2u8, fv, lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl InferTy : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -754,17 +718,6 @@ enum InferRegion {
ReSkolemized(uint, bound_region)
}
#[cfg(stage0)]
impl InferRegion : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
ReVar(ref rv) => to_bytes::iter_bytes_2(&0u8, rv, lsb0, f),
ReSkolemized(ref v, _) => to_bytes::iter_bytes_2(&1u8, v, lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl InferRegion : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -791,21 +744,6 @@ impl InferRegion : cmp::Eq {
}
}
#[cfg(stage0)]
impl param_bound : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
bound_copy => 0u8.iter_bytes(lsb0, f),
bound_owned => 1u8.iter_bytes(lsb0, f),
bound_send => 2u8.iter_bytes(lsb0, f),
bound_const => 3u8.iter_bytes(lsb0, f),
bound_trait(ref t) =>
to_bytes::iter_bytes_2(&4u8, t, lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl param_bound : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -877,70 +815,30 @@ impl purity: purity_to_str {
}
}
#[cfg(stage0)]
impl RegionVid : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl RegionVid : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)
}
}
#[cfg(stage0)]
impl TyVid : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl TyVid : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)
}
}
#[cfg(stage0)]
impl IntVid : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl IntVid : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)
}
}
#[cfg(stage0)]
impl FloatVid : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl FloatVid : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)
}
}
#[cfg(stage0)]
impl FnVid : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl FnVid : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)
@ -2756,25 +2654,6 @@ fn index_sty(cx: ctxt, sty: &sty) -> Option<mt> {
}
}
#[cfg(stage0)]
impl bound_region : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
ty::br_self => 0u8.iter_bytes(lsb0, f),
ty::br_anon(ref idx) =>
to_bytes::iter_bytes_2(&1u8, idx, lsb0, f),
ty::br_named(ref ident) =>
to_bytes::iter_bytes_2(&2u8, ident, lsb0, f),
ty::br_cap_avoid(ref id, ref br) =>
to_bytes::iter_bytes_3(&3u8, id, br, lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl bound_region : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -2792,28 +2671,6 @@ impl bound_region : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl Region : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
re_bound(ref br) =>
to_bytes::iter_bytes_2(&0u8, br, lsb0, f),
re_free(ref id, ref br) =>
to_bytes::iter_bytes_3(&1u8, id, br, lsb0, f),
re_scope(ref id) =>
to_bytes::iter_bytes_2(&2u8, id, lsb0, f),
re_infer(ref id) =>
to_bytes::iter_bytes_2(&3u8, id, lsb0, f),
re_static => 4u8.iter_bytes(lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl Region : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -2834,23 +2691,6 @@ impl Region : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl vstore : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
vstore_fixed(ref u) =>
to_bytes::iter_bytes_2(&0u8, u, lsb0, f),
vstore_uniq => 1u8.iter_bytes(lsb0, f),
vstore_box => 2u8.iter_bytes(lsb0, f),
vstore_slice(ref r) =>
to_bytes::iter_bytes_2(&3u8, r, lsb0, f),
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl vstore : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -2866,16 +2706,6 @@ impl vstore : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl substs : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_3(&self.self_r,
&self.self_ty,
&self.tps, lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl substs : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_3(&self.self_r,
@ -2884,15 +2714,6 @@ impl substs : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl mt : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.ty,
&self.mutbl, lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl mt : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.ty,
@ -2900,15 +2721,6 @@ impl mt : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl field : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.ident,
&self.mt, lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl field : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.ident,
@ -2916,15 +2728,6 @@ impl field : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl arg : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.mode,
&self.ty, lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl arg : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.mode,
@ -2932,19 +2735,6 @@ impl arg : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl FnMeta : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_5(&self.purity,
&self.proto,
&self.region,
&self.bounds,
&self.ret_style,
lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl FnMeta : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_5(&self.purity,
@ -2956,16 +2746,6 @@ impl FnMeta : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl FnSig : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.inputs,
&self.output,
lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl FnSig : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.inputs,
@ -2974,86 +2754,6 @@ impl FnSig : to_bytes::IterBytes {
}
}
#[cfg(stage0)]
impl sty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
ty_nil => 0u8.iter_bytes(lsb0, f),
ty_bool => 1u8.iter_bytes(lsb0, f),
ty_int(ref t) =>
to_bytes::iter_bytes_2(&2u8, t, lsb0, f),
ty_uint(ref t) =>
to_bytes::iter_bytes_2(&3u8, t, lsb0, f),
ty_float(ref t) =>
to_bytes::iter_bytes_2(&4u8, t, lsb0, f),
ty_estr(ref v) =>
to_bytes::iter_bytes_2(&5u8, v, lsb0, f),
ty_enum(ref did, ref substs) =>
to_bytes::iter_bytes_3(&6u8, did, substs, lsb0, f),
ty_box(ref mt) =>
to_bytes::iter_bytes_2(&7u8, mt, lsb0, f),
ty_evec(ref mt, ref v) =>
to_bytes::iter_bytes_3(&8u8, mt, v, lsb0, f),
ty_unboxed_vec(ref mt) =>
to_bytes::iter_bytes_2(&9u8, mt, lsb0, f),
ty_tup(ref ts) =>
to_bytes::iter_bytes_2(&10u8, ts, lsb0, f),
ty_rec(ref fs) =>
to_bytes::iter_bytes_2(&11u8, fs, lsb0, f),
ty_fn(ref ft) =>
to_bytes::iter_bytes_3(&12u8,
&ft.meta,
&ft.sig,
lsb0, f),
ty_self => 13u8.iter_bytes(lsb0, f),
ty_infer(ref v) =>
to_bytes::iter_bytes_2(&14u8, v, lsb0, f),
ty_param(ref p) =>
to_bytes::iter_bytes_2(&15u8, p, lsb0, f),
ty_type => 16u8.iter_bytes(lsb0, f),
ty_bot => 17u8.iter_bytes(lsb0, f),
ty_ptr(ref mt) =>
to_bytes::iter_bytes_2(&18u8, mt, lsb0, f),
ty_uniq(ref mt) =>
to_bytes::iter_bytes_2(&19u8, mt, lsb0, f),
ty_trait(ref did, ref substs, ref v) =>
to_bytes::iter_bytes_4(&20u8, did, substs, v, lsb0, f),
ty_opaque_closure_ptr(ref ck) =>
to_bytes::iter_bytes_2(&21u8, ck, lsb0, f),
ty_opaque_box => 22u8.iter_bytes(lsb0, f),
ty_class(ref did, ref substs) =>
to_bytes::iter_bytes_3(&23u8, did, substs, lsb0, f),
ty_rptr(ref r, ref mt) =>
to_bytes::iter_bytes_3(&24u8, r, mt, lsb0, f),
ty_err => 25u8.iter_bytes(lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl sty : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {

View File

@ -488,23 +488,6 @@ impl Constraint : cmp::Eq {
pure fn ne(&self, other: &Constraint) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl Constraint : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
ConstrainVarSubVar(ref v0, ref v1) =>
to_bytes::iter_bytes_3(&0u8, v0, v1, lsb0, f),
ConstrainRegSubVar(ref ra, ref va) =>
to_bytes::iter_bytes_3(&1u8, ra, va, lsb0, f),
ConstrainVarSubReg(ref va, ref ra) =>
to_bytes::iter_bytes_3(&2u8, va, ra, lsb0, f)
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl Constraint : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -532,14 +515,6 @@ impl TwoRegions : cmp::Eq {
pure fn ne(&self, other: &TwoRegions) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl TwoRegions : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.a, &self.b, lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl TwoRegions : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.a, &self.b, lsb0, f)

View File

@ -737,15 +737,6 @@ impl Url : Eq {
}
}
#[cfg(stage0)]
impl Url: IterBytes {
pure fn iter_bytes(lsb0: bool, f: to_bytes::Cb) {
unsafe { self.to_str() }.iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl Url: IterBytes {
pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
unsafe { self.to_str() }.iter_bytes(lsb0, f)

View File

@ -85,7 +85,7 @@ pub mod par;
pub mod cmp;
pub mod base64;
pub mod rl;
// pub mod workcache;
pub mod workcache;
#[cfg(unicode)]
mod unicode;

View File

@ -74,19 +74,6 @@ struct WorkKey {
name: ~str
}
#[cfg(stage0)]
impl WorkKey: to_bytes::IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
let mut flag = true;
self.kind.iter_bytes(lsb0, |bytes| {flag = f(bytes); flag});
if !flag { return; }
self.name.iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl WorkKey: to_bytes::IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {

View File

@ -54,15 +54,6 @@ impl ident: cmp::Eq {
pure fn ne(&self, other: &ident) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl ident: to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
self.repr.iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl ident: to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
self.repr.iter_bytes(lsb0, f)
@ -311,25 +302,6 @@ enum binding_mode {
bind_by_implicit_ref
}
#[cfg(stage0)]
impl binding_mode : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
bind_by_value => 0u8.iter_bytes(lsb0, f),
bind_by_move => 1u8.iter_bytes(lsb0, f),
bind_by_ref(ref m) =>
to_bytes::iter_bytes_2(&2u8, m, lsb0, f),
bind_by_implicit_ref =>
3u8.iter_bytes(lsb0, f),
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl binding_mode : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -406,15 +378,6 @@ enum pat_ {
#[auto_deserialize]
enum mutability { m_mutbl, m_imm, m_const, }
#[cfg(stage0)]
impl mutability : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl mutability : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -444,15 +407,6 @@ impl Proto : cmp::Eq {
pure fn ne(&self, other: &Proto) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl Proto : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as uint).iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl Proto : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as uint).iter_bytes(lsb0, f);
@ -576,21 +530,6 @@ enum inferable<T> {
infer(node_id)
}
#[cfg(stage0)]
impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
match self {
expl(ref t) =>
to_bytes::iter_bytes_2(&0u8, t, lsb0, f),
infer(ref n) =>
to_bytes::iter_bytes_2(&1u8, n, lsb0, f),
}
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
match *self {
@ -628,14 +567,6 @@ impl<T:cmp::Eq> inferable<T> : cmp::Eq {
#[auto_deserialize]
enum rmode { by_ref, by_val, by_move, by_copy }
#[cfg(stage0)]
impl rmode : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl rmode : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -985,14 +916,6 @@ enum trait_method {
#[auto_deserialize]
enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
#[cfg(stage0)]
impl int_ty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl int_ty : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -1023,14 +946,6 @@ impl int_ty : cmp::Eq {
#[auto_deserialize]
enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
#[cfg(stage0)]
impl uint_ty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl uint_ty : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -1059,14 +974,6 @@ impl uint_ty : cmp::Eq {
#[auto_deserialize]
enum float_ty { ty_f, ty_f32, ty_f64, }
#[cfg(stage0)]
impl float_ty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl float_ty : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -1212,15 +1119,6 @@ impl Ty : cmp::Eq {
}
}
#[cfg(stage0)]
impl Ty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl Ty : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
@ -1248,15 +1146,6 @@ enum purity {
extern_fn, // declared with "extern fn"
}
#[cfg(stage0)]
impl purity : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl purity : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -1278,14 +1167,6 @@ enum ret_style {
return_val, // everything else
}
#[cfg(stage0)]
impl ret_style : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl ret_style : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)
@ -1635,14 +1516,6 @@ enum item_ {
#[auto_deserialize]
enum class_mutability { class_mutable, class_immutable }
#[cfg(stage0)]
impl class_mutability : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as u8).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl class_mutability : to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(*self as u8).iter_bytes(lsb0, f)

View File

@ -252,15 +252,6 @@ pure fn is_call_expr(e: @expr) -> bool {
}
// This makes def_id hashable
#[cfg(stage0)]
impl def_id : core::to_bytes::IterBytes {
#[inline(always)]
pure fn iter_bytes(+lsb0: bool, f: core::to_bytes::Cb) {
core::to_bytes::iter_bytes_2(&self.crate, &self.node, lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl def_id : core::to_bytes::IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, +lsb0: bool, f: core::to_bytes::Cb) {

View File

@ -72,15 +72,6 @@ impl BytePos: Num {
static pure fn from_int(+n: int) -> BytePos { BytePos(n as uint) }
}
#[cfg(stage0)]
impl BytePos: to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl BytePos: to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)
@ -127,14 +118,6 @@ impl CharPos: Num {
static pure fn from_int(+n: int) -> CharPos { CharPos(n as uint) }
}
#[cfg(stage0)]
impl CharPos: to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(*self).iter_bytes(lsb0, f)
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl CharPos: to_bytes::IterBytes {
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
(**self).iter_bytes(lsb0, f)

View File

@ -36,15 +36,6 @@ impl ObsoleteSyntax : cmp::Eq {
}
}
#[cfg(stage0)]
impl ObsoleteSyntax: to_bytes::IterBytes {
#[inline(always)]
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
(self as uint).iter_bytes(lsb0, f);
}
}
#[cfg(stage1)]
#[cfg(stage2)]
impl ObsoleteSyntax: to_bytes::IterBytes {
#[inline(always)]
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {