Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f89d4ac

Browse files
committedNov 30, 2012
Merge pull request #4081 from graydon/iterbytes-and-workcache
libs: Remove transitionary material on iter_bytes, add workcache to buil...
2 parents 946427b + d783f4d commit f89d4ac

File tree

13 files changed

+1
-885
lines changed

13 files changed

+1
-885
lines changed
 

‎src/libcore/to_bytes.rs

Lines changed: 0 additions & 335 deletions
Large diffs are not rendered by default.

‎src/librustc/middle/borrowck/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,6 @@ impl root_map_key : cmp::Eq {
424424
}
425425
}
426426

427-
#[cfg(stage0)]
428-
impl root_map_key : to_bytes::IterBytes {
429-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
430-
to_bytes::iter_bytes_2(&self.id, &self.derefs, lsb0, f);
431-
}
432-
}
433-
#[cfg(stage1)]
434-
#[cfg(stage2)]
435427
impl root_map_key : to_bytes::IterBytes {
436428
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
437429
to_bytes::iter_bytes_2(&self.id, &self.derefs, lsb0, f);

‎src/librustc/middle/trans/common.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,22 +1170,6 @@ impl mono_id_ : cmp::Eq {
11701170
pure fn ne(&self, other: &mono_id_) -> bool { !(*self).eq(other) }
11711171
}
11721172
1173-
#[cfg(stage0)]
1174-
impl mono_param_id : to_bytes::IterBytes {
1175-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1176-
match self {
1177-
mono_precise(t, mids) =>
1178-
to_bytes::iter_bytes_3(&0u8, &ty::type_id(t), &mids, lsb0, f),
1179-
1180-
mono_any => 1u8.iter_bytes(lsb0, f),
1181-
1182-
mono_repr(ref a, ref b, ref c, ref d) =>
1183-
to_bytes::iter_bytes_5(&2u8, a, b, c, d, lsb0, f)
1184-
}
1185-
}
1186-
}
1187-
#[cfg(stage1)]
1188-
#[cfg(stage2)]
11891173
impl mono_param_id : to_bytes::IterBytes {
11901174
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
11911175
match *self {
@@ -1200,14 +1184,6 @@ impl mono_param_id : to_bytes::IterBytes {
12001184
}
12011185
}
12021186
1203-
#[cfg(stage0)]
1204-
impl mono_id_ : core::to_bytes::IterBytes {
1205-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1206-
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);
1207-
}
1208-
}
1209-
#[cfg(stage1)]
1210-
#[cfg(stage2)]
12111187
impl mono_id_ : core::to_bytes::IterBytes {
12121188
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
12131189
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);

‎src/librustc/middle/trans/datum.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ impl DatumMode: cmp::Eq {
145145
pure fn ne(&self, other: &DatumMode) -> bool { !(*self).eq(other) }
146146
}
147147

148-
#[cfg(stage0)]
149-
impl DatumMode: to_bytes::IterBytes {
150-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
151-
(self as uint).iter_bytes(lsb0, f)
152-
}
153-
}
154-
#[cfg(stage1)]
155-
#[cfg(stage2)]
156148
impl DatumMode: to_bytes::IterBytes {
157149
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
158150
(*self as uint).iter_bytes(lsb0, f)

‎src/librustc/middle/ty.rs

Lines changed: 0 additions & 300 deletions
Large diffs are not rendered by default.

‎src/librustc/middle/typeck/infer/region_inference.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -488,23 +488,6 @@ impl Constraint : cmp::Eq {
488488
pure fn ne(&self, other: &Constraint) -> bool { !(*self).eq(other) }
489489
}
490490

491-
#[cfg(stage0)]
492-
impl Constraint : to_bytes::IterBytes {
493-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
494-
match self {
495-
ConstrainVarSubVar(ref v0, ref v1) =>
496-
to_bytes::iter_bytes_3(&0u8, v0, v1, lsb0, f),
497-
498-
ConstrainRegSubVar(ref ra, ref va) =>
499-
to_bytes::iter_bytes_3(&1u8, ra, va, lsb0, f),
500-
501-
ConstrainVarSubReg(ref va, ref ra) =>
502-
to_bytes::iter_bytes_3(&2u8, va, ra, lsb0, f)
503-
}
504-
}
505-
}
506-
#[cfg(stage1)]
507-
#[cfg(stage2)]
508491
impl Constraint : to_bytes::IterBytes {
509492
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
510493
match *self {
@@ -532,14 +515,6 @@ impl TwoRegions : cmp::Eq {
532515
pure fn ne(&self, other: &TwoRegions) -> bool { !(*self).eq(other) }
533516
}
534517

535-
#[cfg(stage0)]
536-
impl TwoRegions : to_bytes::IterBytes {
537-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
538-
to_bytes::iter_bytes_2(&self.a, &self.b, lsb0, f)
539-
}
540-
}
541-
#[cfg(stage1)]
542-
#[cfg(stage2)]
543518
impl TwoRegions : to_bytes::IterBytes {
544519
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
545520
to_bytes::iter_bytes_2(&self.a, &self.b, lsb0, f)

‎src/libstd/net_url.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -737,15 +737,6 @@ impl Url : Eq {
737737
}
738738
}
739739

740-
#[cfg(stage0)]
741-
impl Url: IterBytes {
742-
pure fn iter_bytes(lsb0: bool, f: to_bytes::Cb) {
743-
unsafe { self.to_str() }.iter_bytes(lsb0, f)
744-
}
745-
}
746-
747-
#[cfg(stage1)]
748-
#[cfg(stage2)]
749740
impl Url: IterBytes {
750741
pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
751742
unsafe { self.to_str() }.iter_bytes(lsb0, f)

‎src/libstd/std.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub mod par;
8585
pub mod cmp;
8686
pub mod base64;
8787
pub mod rl;
88-
// pub mod workcache;
88+
pub mod workcache;
8989

9090
#[cfg(unicode)]
9191
mod unicode;

‎src/libstd/workcache.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,6 @@ struct WorkKey {
7474
name: ~str
7575
}
7676

77-
#[cfg(stage0)]
78-
impl WorkKey: to_bytes::IterBytes {
79-
#[inline(always)]
80-
pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
81-
let mut flag = true;
82-
self.kind.iter_bytes(lsb0, |bytes| {flag = f(bytes); flag});
83-
if !flag { return; }
84-
self.name.iter_bytes(lsb0, f);
85-
}
86-
}
87-
88-
#[cfg(stage1)]
89-
#[cfg(stage2)]
9077
impl WorkKey: to_bytes::IterBytes {
9178
#[inline(always)]
9279
pure fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {

‎src/libsyntax/ast.rs

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ impl ident: cmp::Eq {
5454
pure fn ne(&self, other: &ident) -> bool { !(*self).eq(other) }
5555
}
5656

57-
#[cfg(stage0)]
58-
impl ident: to_bytes::IterBytes {
59-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
60-
self.repr.iter_bytes(lsb0, f)
61-
}
62-
}
63-
64-
#[cfg(stage1)]
65-
#[cfg(stage2)]
6657
impl ident: to_bytes::IterBytes {
6758
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
6859
self.repr.iter_bytes(lsb0, f)
@@ -311,25 +302,6 @@ enum binding_mode {
311302
bind_by_implicit_ref
312303
}
313304

314-
#[cfg(stage0)]
315-
impl binding_mode : to_bytes::IterBytes {
316-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
317-
match self {
318-
bind_by_value => 0u8.iter_bytes(lsb0, f),
319-
320-
bind_by_move => 1u8.iter_bytes(lsb0, f),
321-
322-
bind_by_ref(ref m) =>
323-
to_bytes::iter_bytes_2(&2u8, m, lsb0, f),
324-
325-
bind_by_implicit_ref =>
326-
3u8.iter_bytes(lsb0, f),
327-
}
328-
}
329-
}
330-
331-
#[cfg(stage1)]
332-
#[cfg(stage2)]
333305
impl binding_mode : to_bytes::IterBytes {
334306
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
335307
match *self {
@@ -406,15 +378,6 @@ enum pat_ {
406378
#[auto_deserialize]
407379
enum mutability { m_mutbl, m_imm, m_const, }
408380

409-
#[cfg(stage0)]
410-
impl mutability : to_bytes::IterBytes {
411-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
412-
(self as u8).iter_bytes(lsb0, f)
413-
}
414-
}
415-
416-
#[cfg(stage1)]
417-
#[cfg(stage2)]
418381
impl mutability : to_bytes::IterBytes {
419382
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
420383
(*self as u8).iter_bytes(lsb0, f)
@@ -444,15 +407,6 @@ impl Proto : cmp::Eq {
444407
pure fn ne(&self, other: &Proto) -> bool { !(*self).eq(other) }
445408
}
446409

447-
#[cfg(stage0)]
448-
impl Proto : to_bytes::IterBytes {
449-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
450-
(self as uint).iter_bytes(lsb0, f);
451-
}
452-
}
453-
454-
#[cfg(stage1)]
455-
#[cfg(stage2)]
456410
impl Proto : to_bytes::IterBytes {
457411
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
458412
(*self as uint).iter_bytes(lsb0, f);
@@ -576,21 +530,6 @@ enum inferable<T> {
576530
infer(node_id)
577531
}
578532

579-
#[cfg(stage0)]
580-
impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
581-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
582-
match self {
583-
expl(ref t) =>
584-
to_bytes::iter_bytes_2(&0u8, t, lsb0, f),
585-
586-
infer(ref n) =>
587-
to_bytes::iter_bytes_2(&1u8, n, lsb0, f),
588-
}
589-
}
590-
}
591-
592-
#[cfg(stage1)]
593-
#[cfg(stage2)]
594533
impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
595534
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
596535
match *self {
@@ -628,14 +567,6 @@ impl<T:cmp::Eq> inferable<T> : cmp::Eq {
628567
#[auto_deserialize]
629568
enum rmode { by_ref, by_val, by_move, by_copy }
630569

631-
#[cfg(stage0)]
632-
impl rmode : to_bytes::IterBytes {
633-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
634-
(self as u8).iter_bytes(lsb0, f)
635-
}
636-
}
637-
#[cfg(stage1)]
638-
#[cfg(stage2)]
639570
impl rmode : to_bytes::IterBytes {
640571
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
641572
(*self as u8).iter_bytes(lsb0, f)
@@ -985,14 +916,6 @@ enum trait_method {
985916
#[auto_deserialize]
986917
enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
987918

988-
#[cfg(stage0)]
989-
impl int_ty : to_bytes::IterBytes {
990-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
991-
(self as u8).iter_bytes(lsb0, f)
992-
}
993-
}
994-
#[cfg(stage1)]
995-
#[cfg(stage2)]
996919
impl int_ty : to_bytes::IterBytes {
997920
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
998921
(*self as u8).iter_bytes(lsb0, f)
@@ -1023,14 +946,6 @@ impl int_ty : cmp::Eq {
1023946
#[auto_deserialize]
1024947
enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
1025948

1026-
#[cfg(stage0)]
1027-
impl uint_ty : to_bytes::IterBytes {
1028-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1029-
(self as u8).iter_bytes(lsb0, f)
1030-
}
1031-
}
1032-
#[cfg(stage1)]
1033-
#[cfg(stage2)]
1034949
impl uint_ty : to_bytes::IterBytes {
1035950
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
1036951
(*self as u8).iter_bytes(lsb0, f)
@@ -1059,14 +974,6 @@ impl uint_ty : cmp::Eq {
1059974
#[auto_deserialize]
1060975
enum float_ty { ty_f, ty_f32, ty_f64, }
1061976

1062-
#[cfg(stage0)]
1063-
impl float_ty : to_bytes::IterBytes {
1064-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1065-
(self as u8).iter_bytes(lsb0, f)
1066-
}
1067-
}
1068-
#[cfg(stage1)]
1069-
#[cfg(stage2)]
1070977
impl float_ty : to_bytes::IterBytes {
1071978
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
1072979
(*self as u8).iter_bytes(lsb0, f)
@@ -1212,15 +1119,6 @@ impl Ty : cmp::Eq {
12121119
}
12131120
}
12141121

1215-
#[cfg(stage0)]
1216-
impl Ty : to_bytes::IterBytes {
1217-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1218-
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
1219-
}
1220-
}
1221-
1222-
#[cfg(stage1)]
1223-
#[cfg(stage2)]
12241122
impl Ty : to_bytes::IterBytes {
12251123
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
12261124
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
@@ -1248,15 +1146,6 @@ enum purity {
12481146
extern_fn, // declared with "extern fn"
12491147
}
12501148

1251-
#[cfg(stage0)]
1252-
impl purity : to_bytes::IterBytes {
1253-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1254-
(self as u8).iter_bytes(lsb0, f)
1255-
}
1256-
}
1257-
1258-
#[cfg(stage1)]
1259-
#[cfg(stage2)]
12601149
impl purity : to_bytes::IterBytes {
12611150
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
12621151
(*self as u8).iter_bytes(lsb0, f)
@@ -1278,14 +1167,6 @@ enum ret_style {
12781167
return_val, // everything else
12791168
}
12801169

1281-
#[cfg(stage0)]
1282-
impl ret_style : to_bytes::IterBytes {
1283-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1284-
(self as u8).iter_bytes(lsb0, f)
1285-
}
1286-
}
1287-
#[cfg(stage1)]
1288-
#[cfg(stage2)]
12891170
impl ret_style : to_bytes::IterBytes {
12901171
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
12911172
(*self as u8).iter_bytes(lsb0, f)
@@ -1635,14 +1516,6 @@ enum item_ {
16351516
#[auto_deserialize]
16361517
enum class_mutability { class_mutable, class_immutable }
16371518

1638-
#[cfg(stage0)]
1639-
impl class_mutability : to_bytes::IterBytes {
1640-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
1641-
(self as u8).iter_bytes(lsb0, f)
1642-
}
1643-
}
1644-
#[cfg(stage1)]
1645-
#[cfg(stage2)]
16461519
impl class_mutability : to_bytes::IterBytes {
16471520
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
16481521
(*self as u8).iter_bytes(lsb0, f)

‎src/libsyntax/ast_util.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,6 @@ pure fn is_call_expr(e: @expr) -> bool {
252252
}
253253

254254
// This makes def_id hashable
255-
#[cfg(stage0)]
256-
impl def_id : core::to_bytes::IterBytes {
257-
#[inline(always)]
258-
pure fn iter_bytes(+lsb0: bool, f: core::to_bytes::Cb) {
259-
core::to_bytes::iter_bytes_2(&self.crate, &self.node, lsb0, f);
260-
}
261-
}
262-
#[cfg(stage1)]
263-
#[cfg(stage2)]
264255
impl def_id : core::to_bytes::IterBytes {
265256
#[inline(always)]
266257
pure fn iter_bytes(&self, +lsb0: bool, f: core::to_bytes::Cb) {

‎src/libsyntax/codemap.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,6 @@ impl BytePos: Num {
7272
static pure fn from_int(+n: int) -> BytePos { BytePos(n as uint) }
7373
}
7474

75-
#[cfg(stage0)]
76-
impl BytePos: to_bytes::IterBytes {
77-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
78-
(*self).iter_bytes(lsb0, f)
79-
}
80-
}
81-
82-
#[cfg(stage1)]
83-
#[cfg(stage2)]
8475
impl BytePos: to_bytes::IterBytes {
8576
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
8677
(**self).iter_bytes(lsb0, f)
@@ -127,14 +118,6 @@ impl CharPos: Num {
127118
static pure fn from_int(+n: int) -> CharPos { CharPos(n as uint) }
128119
}
129120

130-
#[cfg(stage0)]
131-
impl CharPos: to_bytes::IterBytes {
132-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
133-
(*self).iter_bytes(lsb0, f)
134-
}
135-
}
136-
#[cfg(stage1)]
137-
#[cfg(stage2)]
138121
impl CharPos: to_bytes::IterBytes {
139122
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
140123
(**self).iter_bytes(lsb0, f)

‎src/libsyntax/parse/obsolete.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ impl ObsoleteSyntax : cmp::Eq {
3636
}
3737
}
3838

39-
#[cfg(stage0)]
40-
impl ObsoleteSyntax: to_bytes::IterBytes {
41-
#[inline(always)]
42-
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
43-
(self as uint).iter_bytes(lsb0, f);
44-
}
45-
}
46-
#[cfg(stage1)]
47-
#[cfg(stage2)]
4839
impl ObsoleteSyntax: to_bytes::IterBytes {
4940
#[inline(always)]
5041
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {

0 commit comments

Comments
 (0)
Please sign in to comment.