about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-01 22:41:48 +0000
committerbors <bors@rust-lang.org>2014-11-01 22:41:48 +0000
commit3327ecca422046699315122345c6c050ab73804b (patch)
tree7e89baf5784749a8c5f5e0578bfa7d4302ddfa2f /src/rustllvm/RustWrapper.cpp
parent39f90aead4ad52de1d2c50418da4d66320233d8e (diff)
parent05f6bdaefc7e0b94ea0b1892e6fe5dc79cd2514d (diff)
downloadrust-3327ecca422046699315122345c6c050ab73804b.tar.gz
rust-3327ecca422046699315122345c6c050ab73804b.zip
auto merge of #17595 : danburkert/rust/tuple-index-deserialization, r=alexcrichton
Currently `Decoder` implementations are not provided the tuple arity as
a parameter to `read_tuple`. This forces all encoder/decoder combos to
serialize the arity along with the elements. Tuple-arity is always known
statically at the decode site, because it is part of the type of the
tuple, so it could instead be provided as an argument to `read_tuple`,
as it is to `read_struct`.

The upside to this is that serialized tuples could become smaller in
encoder/decoder implementations which choose not to serialize type
(arity) information. For example, @TyOverby's
[binary-encode](https://github.com/TyOverby/binary-encode) format is
currently forced to serialize the tuple-arity along with every tuple,
despite the information being statically known at the decode site.

A downside to this change is that the tuple-arity of serialized tuples
can no longer be automatically checked during deserialization. However,
for formats which do serialize the tuple-arity, either explicitly (rbml)
or implicitly (json), this check can be added to the `read_tuple` method.

The signature of `Deserialize::read_tuple` and
`Deserialize::read_tuple_struct` are changed, and thus binary
backwards-compatibility is broken. This change does *not* force
serialization formats to change, and thus does not break decoding values
serialized prior to this change.

[breaking-change]
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions