Skip to content

Commit c2aa49a

Browse files
committed
---
yaml --- r: 39850 b: refs/heads/incoming c: fc582bc h: refs/heads/master v: v3
1 parent a4e40f1 commit c2aa49a

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
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: 76bcfe8025249c787cba04f2fb035f4915db0a36
9+
refs/heads/incoming: fc582bcfcedc5154b98b45bb5e41eddfcd3a1f74
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ pub mod reader {
379379
f()
380380
}
381381

382-
fn read_struct<T>(&self, name: &str, f: fn() -> T) -> T {
382+
fn read_struct<T>(&self, name: &str, _len: uint, f: fn() -> T) -> T {
383383
debug!("read_struct(name=%s)", name);
384384
f()
385385
}
@@ -658,7 +658,7 @@ pub mod writer {
658658
}
659659

660660
fn emit_rec(&self, f: fn()) { f() }
661-
fn emit_struct(&self, _name: &str, f: fn()) { f() }
661+
fn emit_struct(&self, _name: &str, _len: uint, f: fn()) { f() }
662662
fn emit_field(&self, name: &str, _idx: uint, f: fn()) {
663663
self._emit_label(name);
664664
f()

branches/incoming/src/libstd/json.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub impl Encoder: serialize::Encoder {
157157
f();
158158
self.wr.write_char('}');
159159
}
160-
fn emit_struct(&self, _name: &str, f: fn()) {
160+
fn emit_struct(&self, _name: &str, _len: uint, f: fn()) {
161161
self.wr.write_char('{');
162162
f();
163163
self.wr.write_char('}');
@@ -270,7 +270,7 @@ pub impl PrettyEncoder: serialize::Encoder {
270270
self.indent -= 2;
271271
self.wr.write_char('}');
272272
}
273-
fn emit_struct(&self, _name: &str, f: fn()) {
273+
fn emit_struct(&self, _name: &str, _len: uint, f: fn()) {
274274
self.emit_rec(f)
275275
}
276276
fn emit_field(&self, name: &str, idx: uint, f: fn()) {
@@ -870,7 +870,7 @@ pub impl Decoder: serialize::Decoder {
870870
move value
871871
}
872872

873-
fn read_struct<T>(&self, _name: &str, f: fn() -> T) -> T {
873+
fn read_struct<T>(&self, _name: &str, _len: uint, f: fn() -> T) -> T {
874874
debug!("read_struct()");
875875
let value = f();
876876
self.pop();

branches/incoming/src/libstd/prettyprint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub impl Serializer: serialize::Encoder {
162162
self.wr.write_str(~"}");
163163
}
164164

165-
fn emit_struct(&self, name: &str, f: fn()) {
165+
fn emit_struct(&self, name: &str, _len: uint, f: fn()) {
166166
self.wr.write_str(fmt!("%s {", name));
167167
f();
168168
self.wr.write_str(~"}");

branches/incoming/src/libstd/serialize.rs

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

6060
fn emit_rec(&self, f: fn());
61-
fn emit_struct(&self, name: &str, f: fn());
61+
fn emit_struct(&self, name: &str, _len: uint, f: fn());
6262
fn emit_field(&self, f_name: &str, f_idx: uint, f: fn());
6363

6464
fn emit_tup(&self, len: uint, f: fn());
@@ -99,7 +99,7 @@ pub trait Decoder {
9999
fn read_vec_elt<T>(&self, idx: uint, f: fn() -> T) -> T;
100100

101101
fn read_rec<T>(&self, f: fn() -> T) -> T;
102-
fn read_struct<T>(&self, name: &str, f: fn() -> T) -> T;
102+
fn read_struct<T>(&self, name: &str, _len: uint, f: fn() -> T) -> T;
103103
fn read_field<T>(&self, name: &str, idx: uint, f: fn() -> T) -> T;
104104

105105
fn read_tup<T>(&self, sz: uint, f: fn() -> T) -> T;

branches/incoming/src/libsyntax/ext/auto_encode.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ would generate two implementations like:
2525
2626
impl<S: Encoder> node_id: Encodable<S> {
2727
fn encode(s: &S) {
28-
do s.emit_struct("Node") {
28+
do s.emit_struct("Node", 1) {
2929
s.emit_field("id", 0, || s.emit_uint(self))
3030
}
3131
}
3232
}
3333
3434
impl<D: Decoder> node_id: Decodable {
3535
static fn decode(d: &D) -> Node {
36-
do d.read_struct("Node") {
36+
do d.read_struct("Node", 1) {
3737
Node {
3838
id: d.read_field(~"x", 0, || decode(d))
3939
}
@@ -709,6 +709,7 @@ fn mk_struct_ser_impl(
709709
),
710710
~[
711711
cx.lit_str(span, @cx.str_of(ident)),
712+
cx.lit_uint(span, vec::len(fields)),
712713
cx.lambda_stmts(span, fields),
713714
]
714715
);
@@ -735,6 +736,7 @@ fn mk_struct_deser_impl(
735736
),
736737
~[
737738
cx.lit_str(span, @cx.str_of(ident)),
739+
cx.lit_uint(span, vec::len(fields)),
738740
cx.lambda_expr(
739741
cx.expr(
740742
span,

0 commit comments

Comments
 (0)