Skip to content

Commit 9d6c3f0

Browse files
committed
---
yaml --- r: 39851 b: refs/heads/incoming c: f1d0478 h: refs/heads/master i: 39849: a4e40f1 39847: 07f1fe9 v: v3
1 parent c2aa49a commit 9d6c3f0

File tree

5 files changed

+59
-1
lines changed

5 files changed

+59
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: fc582bcfcedc5154b98b45bb5e41eddfcd3a1f74
9+
refs/heads/incoming: f1d04780020fed9f6ade87ab39964f6c459aca33
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libstd/ebml.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ pub mod reader {
379379
f()
380380
}
381381

382+
#[cfg(stage0)]
383+
fn read_struct<T>(&self, name: &str, f: fn() -> T) -> T {
384+
debug!("read_struct(name=%s)", name);
385+
f()
386+
}
387+
#[cfg(stage1)]
388+
#[cfg(stage2)]
389+
#[cfg(stage3)]
382390
fn read_struct<T>(&self, name: &str, _len: uint, f: fn() -> T) -> T {
383391
debug!("read_struct(name=%s)", name);
384392
f()
@@ -658,6 +666,11 @@ pub mod writer {
658666
}
659667

660668
fn emit_rec(&self, f: fn()) { f() }
669+
#[cfg(stage0)]
670+
fn emit_struct(&self, _name: &str, f: fn()) { f() }
671+
#[cfg(stage1)]
672+
#[cfg(stage2)]
673+
#[cfg(stage3)]
661674
fn emit_struct(&self, _name: &str, _len: uint, f: fn()) { f() }
662675
fn emit_field(&self, name: &str, _idx: uint, f: fn()) {
663676
self._emit_label(name);

branches/incoming/src/libstd/json.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ pub impl Encoder: serialize::Encoder {
157157
f();
158158
self.wr.write_char('}');
159159
}
160+
#[cfg(stage0)]
161+
fn emit_struct(&self, _name: &str, f: fn()) {
162+
self.wr.write_char('{');
163+
f();
164+
self.wr.write_char('}');
165+
}
166+
#[cfg(stage1)]
167+
#[cfg(stage2)]
168+
#[cfg(stage3)]
160169
fn emit_struct(&self, _name: &str, _len: uint, f: fn()) {
161170
self.wr.write_char('{');
162171
f();
@@ -270,6 +279,13 @@ pub impl PrettyEncoder: serialize::Encoder {
270279
self.indent -= 2;
271280
self.wr.write_char('}');
272281
}
282+
#[cfg(stage0)]
283+
fn emit_struct(&self, _name: &str, f: fn()) {
284+
self.emit_rec(f)
285+
}
286+
#[cfg(stage1)]
287+
#[cfg(stage2)]
288+
#[cfg(stage3)]
273289
fn emit_struct(&self, _name: &str, _len: uint, f: fn()) {
274290
self.emit_rec(f)
275291
}
@@ -870,6 +886,16 @@ pub impl Decoder: serialize::Decoder {
870886
move value
871887
}
872888

889+
#[cfg(stage0)]
890+
fn read_struct<T>(&self, _name: &str, f: fn() -> T) -> T {
891+
debug!("read_struct()");
892+
let value = f();
893+
self.pop();
894+
move value
895+
}
896+
#[cfg(stage1)]
897+
#[cfg(stage2)]
898+
#[cfg(stage3)]
873899
fn read_struct<T>(&self, _name: &str, _len: uint, f: fn() -> T) -> T {
874900
debug!("read_struct()");
875901
let value = f();

branches/incoming/src/libstd/prettyprint.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ pub impl Serializer: serialize::Encoder {
162162
self.wr.write_str(~"}");
163163
}
164164

165+
#[cfg(stage0)]
166+
fn emit_struct(&self, name: &str, f: fn()) {
167+
self.wr.write_str(fmt!("%s {", name));
168+
f();
169+
self.wr.write_str(~"}");
170+
}
171+
#[cfg(stage1)]
172+
#[cfg(stage2)]
173+
#[cfg(stage3)]
165174
fn emit_struct(&self, name: &str, _len: uint, f: fn()) {
166175
self.wr.write_str(fmt!("%s {", name));
167176
f();

branches/incoming/src/libstd/serialize.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ pub trait Encoder {
5858
fn emit_vec_elt(&self, idx: uint, f: fn());
5959

6060
fn emit_rec(&self, f: fn());
61+
#[cfg(stage0)]
62+
fn emit_struct(&self, name: &str, f: fn());
63+
#[cfg(stage1)]
64+
#[cfg(stage2)]
65+
#[cfg(stage3)]
6166
fn emit_struct(&self, name: &str, _len: uint, f: fn());
6267
fn emit_field(&self, f_name: &str, f_idx: uint, f: fn());
6368

@@ -99,6 +104,11 @@ pub trait Decoder {
99104
fn read_vec_elt<T>(&self, idx: uint, f: fn() -> T) -> T;
100105

101106
fn read_rec<T>(&self, f: fn() -> T) -> T;
107+
#[cfg(stage0)]
108+
fn read_struct<T>(&self, name: &str, f: fn() -> T) -> T;
109+
#[cfg(stage1)]
110+
#[cfg(stage2)]
111+
#[cfg(stage3)]
102112
fn read_struct<T>(&self, name: &str, _len: uint, f: fn() -> T) -> T;
103113
fn read_field<T>(&self, name: &str, idx: uint, f: fn() -> T) -> T;
104114

0 commit comments

Comments
 (0)