From ada3e6474d498006ea0918007f9ede3bbe2dea0e Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Mon, 3 Nov 2014 08:39:17 +1300 Subject: [PATCH] Update to rust master --- src/serialization.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/serialization.rs b/src/serialization.rs index afaa425..0ee527d 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -578,10 +578,16 @@ impl serialize::Decoder for Decoder { } fn read_tuple(&mut self, - f: |&mut Decoder, uint| -> Result) + tuple_len: uint, + f: |&mut Decoder| -> Result) -> Result { - self.read_seq(f) + self.read_seq(|d, len| { + assert!(len == tuple_len, + "expected tuple of length `{}`, found tuple \ + of length `{}`", tuple_len, len); + f(d) + }) } fn read_tuple_arg(&mut self, a_idx: uint, f: |&mut Decoder| -> Result) @@ -592,7 +598,8 @@ impl serialize::Decoder for Decoder { fn read_tuple_struct(&mut self, _s_name: &str, - _f: |&mut Decoder, uint| -> Result) + _len: uint, + _f: |&mut Decoder| -> Result) -> Result { panic!()