]> git.lizzy.rs Git - rust.git/commit
serialize: Use assoc types + less old_orphan_check
authorAlex Crichton <alex@alexcrichton.com>
Sun, 4 Jan 2015 06:24:50 +0000 (22:24 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 5 Jan 2015 06:59:26 +0000 (22:59 -0800)
commit0cb7a4062a3c69bb0c54f0c9136889a1006e4f62
tree63d90c804529054b3f8e13a8296cc10b330d2593
parented22606c8382822efc555f72f895c560289a5c70
serialize: Use assoc types + less old_orphan_check

This commit moves the libserialize crate (and will force the hand of the
rustc-serialize crate) to not require the `old_orphan_check` feature gate as
well as using associated types wherever possible. Concretely, the following
changes were made:

* The error type of `Encoder` and `Decoder` is now an associated type, meaning
  that these traits have no type parameters.

* The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable`
  traits have moved to the corresponding method of the trait. This movement
  alleviates the dependency on `old_orphan_check` but implies that
  implementations can no longer be specialized for the type of encoder/decoder
  being implemented.

Due to the trait definitions changing, this is a:

[breaking-change]
20 files changed:
src/librbml/lib.rs
src/librustc/middle/astencode.rs
src/libserialize/collection_impls.rs
src/libserialize/collection_impls_stage0.rs [new file with mode: 0644]
src/libserialize/json.rs
src/libserialize/json_stage0.rs [new file with mode: 0644]
src/libserialize/lib.rs
src/libserialize/serialize.rs
src/libserialize/serialize_stage0.rs [new file with mode: 0644]
src/libsyntax/ast.rs
src/libsyntax/codemap.rs
src/libsyntax/ext/deriving/decodable.rs
src/libsyntax/ext/deriving/encodable.rs
src/libsyntax/owned_slice.rs
src/libsyntax/parse/token.rs
src/libsyntax/ptr.rs
src/test/compile-fail/variance-trait-matching-2.rs [deleted file]
src/test/run-pass/issue-11881.rs
src/test/run-pass/issue-15924.rs
src/test/run-pass/issue-4016.rs